我无法找到如何使用limitTo来切断一个字符串
的任何示例if(score > highScore){ //Will be true always. Not proper condition.
highScore =score;
bestScore = highScore;
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
[prefs setInteger:bestScore forKey:@"bestScore"];
[prefs synchronize];
}
我尝试了相同但却收到错误: -
using like this:
{{'abcdefg' | limitTo:2:5}}
output:
cde