FWCentral Posted July 2, 2012 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.
arezu Posted July 3, 2012 Posted July 3, 2012 example: local theString = "Data1 Data2" local data = split(theString, " ") --data[1] is now "Data1" and data[2] is "Data2"
MTA Team qaisjp Posted July 3, 2012 MTA Team Posted July 3, 2012 Or: local theString = "Data1 Data2" local data1, data2 = unpack(split(theString," ")) Hope that helps you liam
Castillo Posted July 3, 2012 Posted July 3, 2012 Found the answer: Use the Lua split function. He already solved his problem. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
MTA Team qaisjp Posted July 4, 2012 MTA Team Posted July 4, 2012 Found the answer: Use the Lua split function. He already solved his problem. AFTER we told him.
Castillo Posted July 4, 2012 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 ). San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
50p Posted July 5, 2012 Posted July 5, 2012 Enough of that pointless chat. Locked. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
Recommended Posts