0

In C# there is something called @-quoted string literal, it is written like this @"<some text>".

For example, @"a\nb" would consist of the characters 'a', '\', 'n' and 'b', while the normal string "a\nb" would consist of 'a', '\n' and 'b'.

The question is, is there something similar in ObjC? where everything within the string is taken as is.

Daniel
  • 20,420
  • 10
  • 92
  • 149
  • 1
    Closely related: [Raw strings like Python's in ObjC](http://stackoverflow.com/q/2151903) – jscs Jun 10 '15 at 18:49

1 Answers1

1

No. @"" is a reserved NSString literal. You'll unfortunately need to escape the special characters with a backslash.

@"a\\nb"
akashivskyy
  • 44,342
  • 16
  • 106
  • 116