weding3
(WedDev)
#1
-
What do you want to achieve?
I want to find out how I would get a number from a string
-
What solutions have you tried so far?
I looked around on the DevForum but all I can see is how you would change a number with string.gsub
local Word = 'Hello15'
I want to be able to print the 15 with a shorter script than below and automate the process with a loop
My current script:
local Word = 'Hello15'
Word = string.sub(Word,6,#Word)
print(Word) --prints 15
Kaid3n22
(Kaiden)
#2
use gsub
local Word = 'Hello15'
Word = string.gsub(Word, "%D", "")
print(Word)
1 Like
bartkor12
(bartkor12)
#3
Try reading other forums before you post,
weding3
(WedDev)
#4
Thanks, I did look around but I didn’t find that topic