Search code examples
iphoneobjective-ccocoa-touchios4

What is the escape sequence for " " (space) in iPhone SDK?


In my iPhone app, I am having a ASCII art which has lots of spaces in between two characters.

So I need to add the escape sequence for space in place of each space.

What is the Escape Sequence for space in iPhone SDK?


Solution

  • You can use Non-breaking spaces (or other unicode characters) instead:

    NSString* body = @"t   \n e  \n  s \n   t\n";
    body = [body stringByReplacingOccurrencesOfString:@" " withString:@"\u00A0"]; 
    picker.body = body;