How can I delete the prefix "test" from a NSString? I've tried stringByReplacingOccurrencesOfString:
but it's not what I want because it's the prefix that I want to remove not from the other occurrences of the string.
NSString *prefixToRemove = @"test"; NSString *newString = [originalString copy]; if ([originalString hasPrefix:prefixToRemove]) newString = [originalString substringFromIndex:[prefixToRemove length]];
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