Advertisement
Himeki

String to segmented table

Jul 26th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.22 KB | None | 0 0
  1. write( "command?: " )
  2. sInput = read()
  3.  
  4. tArgs = {}
  5.  
  6. for word in sInput:gmatch("(%w+)") do
  7.   table.insert(tArgs, word)
  8. end
  9.  
  10. print( "Results:" )
  11.  
  12. for i=1,#tArgs do
  13.   print( tArgs[i] )
  14. end
  15.  
  16. print( "End Results.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement