Remove All Letters From A String?

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’,’’)
print(clean) --123456[/lua]

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.
For instance:
[lua]
local potato = “I am not Greg”
string.Replace( potato, “not”, “really” )

returns “I am really Greg”
[/lua]

Thank you very much rabbit and MrGregsWorld