How would one go about removing all letters from an input string leaving behind only numbers?
You could use string.gsub with a pattern to match all non-digits( %d matches digits, %D matches not-digits)
[lua]local s = “abc123def456”
local clean = s:gsub(’%D’,’’)
Are you referring to:
[lua]string.Replace( string, toReplace, replacer )[/lua]
I use it to take out the letters in SteamID and just leave the numbers, but it can be used for a lot of things.
local potato = “I am not Greg”
string.Replace( potato, “not”, “really” )
returns “I am really Greg”
Thank you very much rabbit and MrGregsWorld