I am using the following code to replace a portion of the string, this works for normal characters (alphabetical characters) but when it comes to symbols like "•" it can't replace the character.
Any solution?
[myString stringByReplacingOccurrencesOfString:@"•" withString:@"<BULLET_POINT>"];
To replace a character in objective C we will have to use the inbuilt function of Objective C string library, which replaces occurrence of a string with some other string that we want to replace it with.
A static, plain-text Unicode string object which you use when you need reference semantics or other Foundation-specific behavior.
You may not be able to literally insert non-ASCII characters like "•" in a source file. Try using the escape \u2022
instead.
myString = [myString stringByReplacingOccurrencesOfString:@"\u2022" withString:@"<BULLET_POINT>"];
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