fork(6) download
  1. local s = "Cookie hello there sir"
  2.  
  3. local words = {}
  4. words[1], words[2] = s:match("(%w+)(.+)")
  5.  
  6. for k, v in ipairs(words) do
  7. print(k, v)
  8. end
Success #stdin #stdout 0.01s 2540KB
stdin
Standard input is empty
stdout
1	Cookie
2	 hello there sir