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!

[code] myText.text = tostring( getObj().text ) [code]
[import]uid: 95911 topic_id: 16663 reply_id: 316663[/import]

Try this:

[code]
local tempStr = tostring( getObj().text )

myText.text = string.sub(tempStr,1,8)
[/code] [import]uid: 33608 topic_id: 16663 reply_id: 62240[/import]

have you tried the string.sub( theText, 1, 8)

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 16663 reply_id: 62255[/import]

thanks guys. exactly what I needed. [import]uid: 95911 topic_id: 16663 reply_id: 62288[/import]