i have a variable that is bob:23(i have a whole file with similar), how do i make the 23 into its own variable?
Programing question [lua] [question]
Started by Account1, Dec 20 2012 06:46 PM
2 replies to this topic
#1
Posted 20 December 2012 - 06:46 PM
#2
Posted 20 December 2012 - 06:51 PM
Is "bob:23" the value or the identifier?
#3
Posted 20 December 2012 - 06:52 PM
str, val = string.match("bob:23", "([^:])+:(.*)")
str contains bob, val contains 23. See string manipulation.
Edited by Lyqyd, 20 December 2012 - 06:54 PM.
added code tags because forum auto-smily is dumb.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











