在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
var str_componets = "I Like Swift " str_componets.componentsSeparatedByString(" ") 这样,str_componets分成了四部分: ["I", "Like", "Swift", ""]
也可以用NSCharacterSet进行分割: var str_componets = "I would prefer a face-to-face talk with my friends" str_componets.componentsSeparatedByCharactersInSet(NSCharacterSet(charactersInString: " -")) 这样,str_componets分成了: ["I", "would", "prefer", "a", "face", "to", "face", "talk", "with", "my", "friends"] |
请发表评论