NSString *str = @"abcdefghijklmn";
NSString*resultStr;
if(str && str.length>0) {
resultStr = [strstringByReplacingCharactersInRange:NSMakeRange(0,1) withString:[[str substringToIndex:1] capitalizedString]];
}
NSLog(@"%@", resultStr);
NSString *str = @"abcdefghijklmn";
NSString*resultStr;
if(str && str.length>0) {
resultStr = [strstringByReplacingCharactersInRange:NSMakeRange(0,1) withString:[[str substringToIndex:1] capitalizedString]];
}
NSLog(@"%@", resultStr);
本文标题:(IOS)处理字符串,使其首字母大写
本文链接:https://www.haomeiwen.com/subject/hwjlbftx.html
网友评论