Re: want backslash in NSString
Re: want backslash in NSString
- Subject: Re: want backslash in NSString
- From: Andrew Pinski <email@hidden>
- Date: Sun, 30 Dec 2001 21:15:02 -0500
It is NSLog that doing something wrong.
I would save the NSString to a file to test.
Use -writeToFile:(NSString *)path atomically:(BOOL)useAuxiliaryFile;
Thanks,
Andrew Pinski
On Sunday, December 30, 2001, at 09:02 , Christopher Anand wrote:
How do I get a backslash in an NSString?
I have tried the following:
string = [NSString stringWithCString: "\include" length:8]; // give
compiler warning
NSLog(string);
string = [NSString stringWithCString: "\\include" length:8];
NSLog(string);
string = [NSString stringWithCString: "\binclude" length:8];
NSLog(string);
cstring = "\\include";
printf("%s\n",cstring);
with the results:
2001-12-30 20:41:38.144 CircleView[403] include\\000
2001-12-30 20:41:38.145 CircleView[403] \\\\include
2001-12-30 20:41:38.145 CircleView[403] \\010include
\include
Obviously I don't understand text handling in Foundation. I need the
backslash because I am saving a pdf file for inclusion in a latex
document, and I want to put the latex graphics command in the paste
buffer to save me a bit of typing (and a chance for typos).
Christopher Anand
_______________________________________________
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.