FWCentral Posted July 2, 2012 Share Posted July 2, 2012 Hey im trying to split a string into two parts the string will always have a space like this example: "Data1 Data2" How can i make it like this: local data1,data2 = Data1, Data2 i tried: local data1, data2 = table.concat(thestring, ", ") Found the answer: Use the Lua split function. Link to comment
arezu Posted July 3, 2012 Share Posted July 3, 2012 example: local theString = "Data1 Data2" local data = split(theString, " ") --data[1] is now "Data1" and data[2] is "Data2" Link to comment
qaisjp Posted July 3, 2012 Share Posted July 3, 2012 Or: local theString = "Data1 Data2" local data1, data2 = unpack(split(theString," ")) Hope that helps you liam Link to comment
Castillo Posted July 3, 2012 Share Posted July 3, 2012 Found the answer: Use the Lua split function. He already solved his problem. Link to comment
qaisjp Posted July 4, 2012 Share Posted July 4, 2012 Found the answer: Use the Lua split function. He already solved his problem. AFTER we told him. Link to comment
Castillo Posted July 4, 2012 Share Posted July 4, 2012 Found the answer: Use the Lua split function. He already solved his problem. AFTER we told him. No, actually he already solved it before anyone had posted ( I didn't post because it was already solved ). Link to comment
50p Posted July 5, 2012 Share Posted July 5, 2012 Enough of that pointless chat. Locked. Link to comment
Recommended Posts