C#'s @-quoted string literal in ObjC

153 views Asked by At

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.

1

There are 1 answers

0
akashivskyy On BEST ANSWER

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

@"a\\nb"