samir samir - 4 months ago 41
Objective-C Question

NSString replacing character method

Possible Duplicate:

Character encoding in NSString

How i can replace :
with :
by using the
method :

i am doing like this, but it's not working :

myString = [myString stringByReplacingOccurrencesOfString:@"/"/"" withString:@"\"\""];


If I understood correctly what you want: myString = [myString stringByReplacingOccurrencesOfString:@"/"/"" withString:@"\\\"\\\""];

\ is a special character which says: Careful, don't interpret next characters as you always do. Example: Changing line in a NSString is done withe \n. In others words, do not interpret this "n" like a simple "n". I want a change of line.