Piorun Posted December 10, 2011 Posted December 10, 2011 Hi guys! I have problem with my string. I have something like this: "1,2,3,4" and i want to get every number from this string (meybe into table?). I just want to create some fraction system. I have in my MySQL table some row named "members" and in it i have this values "1,2,3,4". I want to check if any player is in fraction (numbers are the ids of the characters). Please, help.
coolman Posted December 10, 2011 Posted December 10, 2011 (edited) I think, use split. Użyj split. [ Btw. daj mi gg na pm ] return ( split( table something, string separator )[ number id ] ) Edited December 10, 2011 by Guest
Evil-Cod3r Posted December 10, 2011 Posted December 10, 2011 i guss like this members = {{1, 2, 3, 4}}
BinSlayer1 Posted December 10, 2011 Posted December 10, 2011 I have problem with my string. I have something like this: "1,2,3,4" and i want to get every number from this string (meybe into table?) str = '1,2,3,4' table = split(str, string.byte(',')) table contains your every character separated by comma in that string. example: table[1] = '1' And if you want to convert from string to number use the function tonumber(str)
coolman Posted December 10, 2011 Posted December 10, 2011 I have problem with my string. I have something like this: "1,2,3,4" and i want to get every number from this string (meybe into table?) str = '1,2,3,4' table = split(str, string.byte(',')) table contains your every character separated by comma in that string. example: table[1] = '1' And if you want to convert from string to number use the function tonumber(str) Spam. I solved it.
BinSlayer1 Posted December 10, 2011 Posted December 10, 2011 I have problem with my string. I have something like this: "1,2,3,4" and i want to get every number from this string (meybe into table?) str = '1,2,3,4' table = split(str, string.byte(',')) table contains your every character separated by comma in that string. example: table[1] = '1' And if you want to convert from string to number use the function tonumber(str) Spam. I solved it. You edited your freaking post so I didn't know.. Don't call mine a spam then.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now