jaamun
jaamun

Reputation: 181

Avoid the use of escape characters in literal strings

Is there a way I can avoid escape sequences in literal strings in Objective-C?

For example, in C#, I can prefix the string with @ and type the string normally, like: @"C:\Users", without the use of the double backslash "C:\\Users"

Is there a way to do this?

Upvotes: 1

Views: 346

Answers (1)

Stream
Stream

Reputation: 9493

There is no way to do this in Objective-C. A construction like @"string" generates an NSString object built from the plain "string". And as far as I know, you cannot avoid escaping in the C language.

Upvotes: 1

Related Questions