Swift 3.0 学习 -- 大写和小写字符串(Uppercase and Lowercase Strings)
来源:互联网 发布:上海java培训机构排名 编辑:程序博客网 时间:2024/06/06 19:18
在swift2.0的时候,您可以通过字符串的uppercaseString
和lowercaseString
属性来访问大写/小写版本的字符串。如下:
let normal = "Could you help me, please?"let shouty = normal.uppercaseString// shouty 值为 "COULD YOU HELP ME, PLEASE?"let whispered = normal.lowercaseString// whispered 值为 "could you help me, please?"
但是在swift3.0中,字符串的
uppercaseString
和lowercaseString
属性被函数 uppercased()和 lowercased()代替,如下:let normal = "Could you help me, please?"let shouty = normal.uppercased()// shouty 值为 "COULD YOU HELP ME, PLEASE?"let whispered = normal.lowercased()// whispered 值为 "could you help me, please?"
0 0
- Swift 3.0 学习 -- 大写和小写字符串(Uppercase and Lowercase Strings)
- swift学习笔记-字符串和字符(Strings and Characters)
- 三 Swift学习之字符串和字符(Strings and Characters)
- Swift学习之十:字符串与字符(Strings and Characters)
- Swift学习之十:字符串与字符(Strings and Characters)
- Swift学习之十:字符串与字符(Strings and Characters)
- Swift 字符串和字符(Strings and Characters)
- capitalize和uppercase都是首字母大写
- 字符串大写转小写
- 输入一个有大写和小写的字符串,把其中的大写转化为小写,小写转化为大写。
- Converting an uppercase letter to lowercase
- angular-过滤器uppercase/lowercase字母大小写转换
- java 判断字符串首字符大写(uppercase或者capital)
- swift学习笔记----Strings and Characters
- 浅谈 my_strlwr和my_strupr 把大写字符串转化为小写
- php strtoupper 和 array_change_key_case 字符串转大写,小写
- iOS 字符串小写转大写
- 汇编-字符串小写转大写
- Windows下RSA密钥生成工具openssl
- SQLServer 重建索引前后对比
- Android手势识别01——基本手势的处理
- Vue动画 和 Vue路由
- 商品展示——实体类和适配器的创建
- Swift 3.0 学习 -- 大写和小写字符串(Uppercase and Lowercase Strings)
- 从Vivado2015.2到Vivado2017.1的TCL搬迁笔记
- BZOJ 2733 [HNOI2012] 永无乡 [splay+启发式合并做法]
- Spring+SpringMVC+MyBatis+easyUI整合优化篇(十二)数据层优化-explain关键字及慢sql优化
- C# INI文件读写类
- iOS应用崩溃日志分析
- es5 编写类风格的代码
- 网络迭代时间测试
- 数据清洗2