lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,
I am write a price of code in Lua to break down phone number to country code, area code, and local code
For instance, 16502839332 -> 1      650    2839332
I have a series of country code, area code that I can match against. 
Previously with another language, I would do a comparision against each code to breakdown the number.  With Lua, is there a more efficient way of doing this?
 
I checked the String function in wiki and can't see anything.  I know I can do a find and then sub to retrieve each code one by one, but I hope that there is a better way to do it.
 
Any suggestion will be greatly appreciated.
 
Thanks,
Pete