import UIKit
let str = "Hello##World##123##!!"
var strTemp : String!
strTemp = str.stringByReplacingOccurrencesOfString("##", withString: "\n", options: NSStringCompareOptions.RegularExpressionSearch, range: nil)
println(strTemp)
The result:
Hello
World
123
!!
Related string function:
componentsSeparatedByCharactersInSet and join - Remove specific characters in a string
Related string function:
componentsSeparatedByCharactersInSet and join - Remove specific characters in a string
No comments:
Post a Comment