samir samir - 1 year ago 128
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:@"\"\""];

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download