我想减去tex_length
和dotPosition
值,我收到错误:
if let t = textField.text
{
let dotPosition = t.rangeOfString(".")?.endIndex.predecessor()
let tex_length = countElements(textfield.text)
print(dotPosition)
print(tex_length)
res = tex_length - dotPosition ;
}