I want to remove "#" from my string.
I have tried
NSString *abc = [@"A#BCD#D" stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"#"]];
But it still shows the string as "A#BCD#D"
What could be wrong?
stringByTrimmingCharactersInSet
removes characters from the beginning and end of your string, not from any place in it
For your purpose use stringByReplacingOccurrencesOfString:withString:
method as others pointed.