Symbols to be escaped in an Objective-C NSString

Want to know the entire character set whose characters must be escaped in an Objective-C NSString in order to be recognized correctly, for example. " must be escaped as \" as in

 NSString *temporaryString = @"That book is dubbed as \"the little book\"."; 

Is the character set the same as the character in the string C language char * ?

Thanks for your help: D

+6
source share
1 answer

The only characters to be escaped are the characters " (double quotation mark) and \ (backslash).

There are other special character literals, such as \n , that have special meaning, but this is really a separate issue.

Values

Objective-C NSString use the same special character set as C.

+9
source

Source: https://habr.com/ru/post/945533/


All Articles