I'm looking for a way to replace a character at a certain index of a NSString.
For example: myString = @"******";
I want to replace the 3rd " * " with an "A", so that the string looks like this: myString = @"**A***";
How can I achieve this?
Thanks in advance
Try with this:
NSString *str = @"*******";
str = [str stringByReplacingCharactersInRange:NSMakeRange(3, 1) withString:@"A"];
NSLog(@"%@",str);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With