标签:
var str_trim = " !hi !23 !"
str_trim.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceCharacterSet())//"!hi !23 !"去掉两边的空格
str_trim.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: "! "))//"hi !23" 去掉两边的空格和‘!’ ,把 字符串中的每个字符进行了分解并去除
标签:
原文地址:http://www.cnblogs.com/SimonGao/p/4211611.html