首页 > 其他 > 详细

九月第一周

时间:2018-09-08 23:12:32      阅读:186      评论:0      收藏:0      [点我收藏+]

1.截取某字符串的前10个字符串:

let sub1 = str.prefix(10) 

截取某字符串的后10个字符串

let str1 = str.suffix(10)

也可以换种写法

let index2 = str.index(str.endIndex, offsetBy: -10)

let sub4 = str[index2..<str.endIndex]

 

截取某字符串的第3个字符到第6个字符范围的字符串

let index3 = str.index(str.startIndex, offsetBy: 3)

let index4 = str.index(str.startIndex, offsetBy: 6)

let sub4 = str[index3..<index4]

 

2. JSONDecoder实现转Model:

https://developer.apple.com/documentation/foundation/jsondecoder

https://www.jianshu.com/p/ca1b9094d0e9

 

3.Swift常用基本第三方:

技术分享图片

九月第一周

原文:https://www.cnblogs.com/pengsi/p/9610865.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!