1谎柄、根據(jù)label的寬高丁侄,自適應(yīng)文字的大小硅堆,讓文字整個填充label
label.numberOfLines = 0;?
label.adjustsFontSizeToFitWidth = YES;
2 使用enumerateObjectsUsingBlock進(jìn)行遍歷的時候陷虎,使用 *stop = yes 停止遍歷?,
使用enumerateObjectsWithOption:UsingBlock:?可以進(jìn)行反向遍歷?
3去掉字符串中的空格
[stringstirngByReplacingOccurrencesOfString:@" "withString:@""];?
?
4判斷一個字符串中是否存在特殊字符?
#defineKAlphaNum =@"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"
NSCharacterSet*cs = [[NSCharacterSetcharacterSetWithCharactersmString:KAlphaNum?] ??invertedSet];
NSString*filtered = [[string componentsSeparatedByCharactersInSet:cs]componentsJonedByString:@""]?
bool basic =[string isEqualToString:filered]; ?