如果我有一个 NSString 看起来像:
2-13-2014 Norway vs Canada Per 1 20-00 2
它正在被解析并且日期会改变
我如何让它变成
Norway vs Canada Per 1
换句话说,把日期和多余的字符放在最后。
我用过:
NSArray * dateComponents = [cleanString
componentsSeparatedByCharactersInSet:
[NSCharacterSet
characterSetWithCharactersInString:@"-"]];
cleanString = [NSString stringWithFormat:@"%@", [dateComponents objectAtIndex:2]];
输出:
2014 Norway vs Canada Per 1 20
谢谢