Jump to content




Detecting length of read()

computer lua command

3 replies to this topic

#1 GemCow

  • Members
  • 8 posts

Posted 22 October 2015 - 09:58 PM

local input = read()
how do i detect the length of the read

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 22 October 2015 - 10:21 PM

#input, input:len(), or string.len(input).

See here for some other things you can do with text strings.

#3 GemCow

  • Members
  • 8 posts

Posted 22 October 2015 - 11:19 PM

View PostBomb Bloke, on 22 October 2015 - 10:21 PM, said:

#input, input:len(), or string.len(input).

See here for some other things you can do with text strings.
nvm, i found out i can do event == 'key'

#4 TYKUHN2

  • Members
  • 210 posts
  • LocationSomewhere in this dimension... I think.

Posted 23 October 2015 - 01:37 AM

read():len() is probably better unless you intend to print it to the screen as it comes in.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users