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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to