NSString *strDay = [dic objectForKey:@"day"];
NSString *uppercaseString = [strDay uppercaseString];
cell.dayLabel.text = uppercaseString;
这是正确的方法吗?但我只得到大写。我希望“sunday”能像“SUN”一样显示在视野中。
答案 0 :(得分:20)
这个怎么样
NSString *uppercaseString = [strDay uppercaseString];
cell.dayLabel.text = [uppercaseString substringToIndex:3];
假设它有一个有效的日子
答案 1 :(得分:3)
NSString *strDay = [dic objectForKey:@"day"];
NSString* split = [strDay substringToIndex:3];
split=[split uppercaseString];
NSLOG(@“%@”,拆分);
干杯!
答案 2 :(得分:0)
NSString *strDay = @"sunday";
NSString *newStr = [strDay substringToIndex:3];
NSString *uppercaseString = [newStr uppercaseString];
答案 3 :(得分:0)
NSString *strDay = [dic objectForKey:@"day"];
cell.dayLabel.text = [strDay.uppercaseString substringToIndex:3]