I am collecting track information (titles) and I would like to trim off
certain things
01 - Barracuda
becomes Barracuda
02 - Love Alive
becomes Love Alive
What is the best way to trim those off the front?
Thanks,
Eric
___
Cocoa-dev mailing list
Regular Expression find and replace? Basically, replace something like @^\\d+
- with @.
Dave
On Jul 18, 2011, at 10:46 AM, Eric E. Dolecki wrote:
I am collecting track information (titles) and I would like to trim off
certain things
01 - Barracuda
becomes Barracuda
02 - Love Alive
Le 18 juil. 2011 à 19:46, Eric E. Dolecki a écrit :
I am collecting track information (titles) and I would like to trim off
certain things
01 - Barracuda
becomes Barracuda
02 - Love Alive
becomes Love Alive
If your prefix is always XX - then you can use -[title
Does this look about right?
NSError *error = NULL;
NSRegularExpression *regex = [NSRegularExpression
regularExpressionWithPattern:@^\\d+ -
options:NSRegularExpressionCaseInsensitive
error:error];
songTitle = [regex stringByReplacingMatchesInString:songTitle