Reputation: 4079
i have a date string looks like this : 8/30/1987
at this time i can find the index of "/" by scan code.
i want to replace the "/" character with "-". how can i do it?
TNX
Upvotes: 0
Views: 142
Reputation: 48398
In general, reading the NSString
documentation will answer questions like this.
For this, you can use the NSString
method – stringByReplacingOccurrencesOfString:withString:
Upvotes: 2
Reputation: 181460
Assuming you have your date on a NSString
object, you can do:
NSString *new = [yourDate stringByReplacingOccurrencesOfString: @"/" withString:@"-"];
Upvotes: 1