var str = labelTel.text!
let intValue: Int = str.startIndex.distanceTo(str.endIndex)
參考資料:
Convert String.Index to Int or Range<String.Index> to NSRange
http://stackoverflow.com/questions/28128554/convert-string-index-to-int-or-rangestring-index-to-nsrange
沒有留言:
張貼留言