Re: Writing Strings to a file and "special" strings.
Re: Writing Strings to a file and "special" strings.
- Subject: Re: Writing Strings to a file and "special" strings.
- From: Jonathan Jackel <email@hidden>
- Date: Sun, 03 Nov 2002 20:33:33 -0500
on 11/3/02 12:50 PM, Jerry LeVan at email@hidden wrote:
>
Do @"\t", @"\r" and @"\n" do the right thing when written to an "ascii"
>
file.
>
Yes. As do the other C escape characters. (There's generally no harm in
trying something like this out to see if it works.)
>
Is there an elegant way to write my giant array with say, my field elements
>
separated by @"\t" and each "line" terminated by @"\n" or @"\r" into an
>
ascii file?
[NSArray componentsJoinedByString:separator] returns a concatenated string.
>
>
Does anyone know why if a textField contains a\bc then NSLog will print the
>
backslash character four times ie
>
>
NSLog(@"result=%@", [textField stringValue]) will print a\\\\b ?
>
Two backslashes is the C escape character for a backslash. There's a bug in
NSLog that prints it out with four backslashes. See the archives:
http://cocoa.mamasam.com/COCOADEV/2002/08/2/42729.php
Jonathan
_______________________________________________
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.