I'm trying to get this line to work:
textView.text = textView.text.substringToIndex(count(textView.text.utf16) - 1)
error: Cannot invoke substringToIndex with an arguement list type int
substringToIndex
takes a String.Index
which is different from an Int. If you want to take the whole string minus the last character, you could do
textView.text = textView.text.substringToIndex(advance(textView.text.endIndex, -1))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With