of     1   

7937746
#41659488Friday, January 28, 2011 8:05 PM GMT

I want to make a table of stuff from a string. How do I replace all spaces in that string with a , ?
BlueTaslem
#41659734Friday, January 28, 2011 8:12 PM GMT

str:gsub( find , replace )
7937746
#41659859Friday, January 28, 2011 8:14 PM GMT

Ok so intheory this would work? Msg = "Combrad rules" New = Msg:gsub(" ",",") loadstring("Words = {"..New.."}")() print(Words)
BlueTaslem
#41659981Friday, January 28, 2011 8:17 PM GMT

That would do Words = {Combrad,rules} so they wouldn't have quotes. What are you trying to do, basically split up a phrase into a table of the words? I can do that for ya: function split(msg) local i = 0 local t = {} local s = "" while i < #msg do i = i + 1 if msg:sub(i,i) == " " then if s ~= "" then t[#t+1] = s s = "" end else s = s .. msg:sub(i,i) end end if s ~= "" then t[#t+1] = s end return t end
7937746
#41660012Friday, January 28, 2011 8:18 PM GMT

My way works it just needs the " on each of the things.
7937746
#41660104Friday, January 28, 2011 8:20 PM GMT

Msg = "Combrad rules" New = Msg:gsub(" ",'","') loadstring('Words = {"'..New..'"}')() print(Words[1],Words[2]) Alot quicker :P

    of     1