Hello all.
I am getting a string returned from a TextField input and I need to cut/limit the returned string to only first 8 characters.
How can I do this ?
thank you!
myText.text = tostring( getObj().text ) <code>
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
Hello all.
I am getting a string returned from a TextField input and I need to cut/limit the returned string to only first 8 characters.
How can I do this ?
thank you!
myText.text = tostring( getObj().text ) <code>
Try this:
1 2 3 | local tempStr = tostring( getObj().text ) myText.text = string.sub(tempStr,1,8) |
have you tried the string.sub( theText, 1, 8)
cheers,
?:)
thanks guys. exactly what I needed.