I am aware of replacing String strings, but this only works if I know exactly what I want to delete.
If I have a line as shown below:
"Hi-there-this-this-test & function = hi-there"
How to remove the '& feature' and everything after that?
Any help would be greatly appreciated. Thanks in advance!
EDIT: If you absolutely need to use REGEX, can someone show me how to use it? I know this is 10.7, but I'm fine with that. Better yet, an example of line trimming or using NSScanner?
Thanks again to everyone.
EDIT: The solution posted below is correct, but led to a crash for me. This is how I solved the problem:
NSString *newString = [[oldString componentsSeparatedByString: @"&feature="] objectAtIndex:0];
source share