美文网首页
iOS 字符串大小写转换(系统方法)

iOS 字符串大小写转换(系统方法)

作者: KingWorld | 来源:发表于2021-07-09 09:52 被阅读0次

    1、所有的小写字母转换成大写

      NSString *ceshi=@"You do not have the corresponding permissions, please contact the system administrator to add";
    
        //所有的小写字母都转换成大写
    
        NSLog(@"first:%@",[ceshi uppercaseString]);
    
      first:YOU DO NOT HAVE THE CORRESPONDING PERMISSIONS, PLEASE CONTACT THE SYSTEM ADMINISTRATOR TO ADD
    

    2、所有的大写字母转换成小写

        NSLog(@"second:%@",[ceshi lowercaseString]);
    
      second:you do not have the corresponding permissions, please contact the system administrator to add
    

    3、所有的首字母大写,其余变成小写

        NSLog(@"third:%@",[ceshi capitalizedString]);
    
      third:You Do Not Have The Corresponding Permissions, Please Contact The System Administrator To Add
    

    相关文章

      网友评论

          本文标题:iOS 字符串大小写转换(系统方法)

          本文链接:https://www.haomeiwen.com/subject/iltfpltx.html