答案 0 :(得分:0)
我设法做到了,因为那些人有一天会需要这些信息:
let string = "theMostInterestingViewOfAllTime" //Default String
var newString = string.stringByReplacingOccurrencesOfString("([a-z])([A-Z])", withString: "$1 $2", options: .RegularExpressionSearch, range:string.rangeOfString(string)) //Here the String will be separated
newString = newString.capitalizedString //Here it will be capitalized
New Range给了我一些问题 - 与我的版本相比,是否有更优雅的方式?