Re: Putting a single " into an NSString or adding it to an NSMutableString?
Re: Putting a single " into an NSString or adding it to an NSMutableString?
- Subject: Re: Putting a single " into an NSString or adding it to an NSMutableString?
- From: Christian Brunschen <email@hidden>
- Date: Fri, 25 Apr 2003 17:23:57 +0200 (MEST)
On Fri, 25 Apr 2003, Mark Ogilvie wrote:
>
I thought it would be easy to do, just put the single quote between two
>
other quotes, but it won't work.
>
So when I try to do this
>
[string appendString:@" " "]; I get an error, and when I try this
>
[string appendString:@"" " ""]; I still get an error, is there a way to
>
do this?
NSString uses the same quoting and escaping rules as C strings in general.
Inside a string, if you want to alter the meaning of a character, you
prefix it with a backslash, '\'. So, to insert a '"' character into a
string, you use '\"' :
NSString *s = @"This string contrains a \" double-quote character";
>
Thanks
>
Mark
>
I get the feeling I'm missing something obvious here.
Best wishes,
// Christian Brunschen
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.