How to transform a NSString to a NSString C string format?
How to transform a NSString to a NSString C string format?
- Subject: How to transform a NSString to a NSString C string format?
- From: Iceberg-Dev <email@hidden>
- Date: Thu, 5 Feb 2009 23:52:34 +0100
Problem:
--------
I would like to transform a NSString to a NSString conforming to the
C string format.
Examples:
---------
toto -> toto
"toto -> \"toto
toto -> toto\ntiti
titi
My Current Solution:
--------------------
I can do this using a NSMutableString and a series of call to:
- replaceOccurrencesOfString:withString:options:range:
The problem I see with this solution is that I will probably forget
some cases.
Question:
---------
Would there be a better solution? (I couldn't find a method in
NSString, NSMutableString CFStringRef APIs but I might missed it).
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden