我正在研究RSS提要,需要将标题和副标题转换为大写字母,有没有简单的方法可以做到这一点?
感谢。
答案 0 :(得分:3)
在cellForRow AtIndexPath
中- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
NSString *string1 = @"The quicK brOwn fox jumpeD";
cell.textLabel.text = [string1 uppercaseString];
....
答案 1 :(得分:1)
NSString* str = @"abcd abcd abcd abcd";
[str capitalizedString]; // = Abcd Abcd Abcd Abcd
[str uppercaseString]; // = ABCD ABCD ABCD ABCD
答案 2 :(得分:0)
uppercaseString, NSString的方法?
答案 3 :(得分:0)
您可以在文本字段属性下的故事板中执行此操作。 将Capitalization下拉列表更改为All Characters。在您的设备上测试它或确保键盘打开。如果您从物理键盘输入,它将覆盖模拟器键盘上的大写字母箭头。