title: Invalid escape sequence in literal: "\b"
body: <p>I need to be able to create a String that is <code>"\b"</code>. But when I try to, Xcode throws a compile-time error: Invalid escape sequence in literal. I don't understand why though, <code>"\r"</code> works just fine. If I put <code>"\\b"</code> then that's what is actually stored in the String, which is not what I need - I only need one backslash. To me, this seems to be a Swift oddity because it works just fine in Objective-C.</p>
  
  <pre><code>let str = "\b" //Invalid escape sequence in literal
  NSString *str = @"\b"; //works great
  </code></pre>
  
  <p>I need to generate this string because <code>"\b"</code> is the only way to detect when the user pressed 'delete' when using <code>UIKeyCommand</code>:</p>
  
  <pre><code>let command = UIKeyCommand(input: "\b", modifierFlags: nil, action: "didHitDelete:")
  </code></pre>
  
  <p>How can I work around this issue?</p>
  
  <p>EDIT: It <strong>really</strong> doesn't want to generate a String that is only <code>"\b"</code>, this does not work - it stays the original value:</p>
  
  <pre><code>var delKey = "\rb"
  delKey = delKey.stringByReplacingOccurrencesOfString("r", withString: "", options: .LiteralSearch, range: nil)
  </code></pre>