//字符串的替换
let ReplaceString = "http://www.aimonkey。cn"
let FilterReplace = ReplaceString.replacingOccurrences(of: "。", with: ".")
print(FilterReplace)
//字符串的删除
let str = ReplaceString.replacingOccurrences(of: "w", with: "")
print(str)
//字符串的截取
//将ReplaceString 转换为OC 的字符串使用,根据范围来截取字符串
let subString1 = (ReplaceString as NSString).substring(with: NSMakeRange(1, 3))
print(subString1)
//截取下标2 之前的字符
let subString2 = (ReplaceString as NSString).substring(to: 2)
print(subString2)
//截取下标2 之后(含有2)
let subString3 = (ReplaceString as NSString).substring(from: 2)
print(subString3)
//字符串的分割
let url = "http://blog.csdn.net/hello_hwc?viewmode=list"
let urled = url.components(separatedBy: "/")
print(urled)
//字符串的拼接
let str = "Hello"
let newStr = str + "work"
print(newStr) //Hellowork
let str = String(format: "称呼 : %@", dic["firstName"]! as! CVarArg)