如何在swift中减去值

时间:2016-06-08 09:04:40

标签: swift

我想减去tex_lengthdotPosition值,我收到错误:

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 ;           
 }

0 个答案:

没有答案