Keep all the numbers from a string

I want to keep the numbers from a string.
I’m trying to make an anti cheat and It’s working right now but I can’t find the answer to this.
I tried to search on the devforum but it just gives me unrelated topics so I’m gonna ask here,

--this is to keep the numbers from a string
string.gsub(string, "%d+", "")

Thanks

2 Likes

While “%d” is for numbers, its opposite - “%D” is everything, except numbers.

5 Likes