a string operation help needed

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.

views:1579 update:2011/10/22 9:46:13
corona forums © 2003-2011