import UIKit
let str = "Hello World This is a long string 1234567890."
var strTemp = str as NSString
//Keep the first 30 characters.
strTemp = strTemp.substringToIndex(30)
strTemp = (strTemp as String) + "..."
println(strTemp)
The result:
Hello World This is a long str...
No comments:
Post a Comment