Removing The First 6 characters from a string

Not sure how i would do this but for instance: string_1
How would i extract the 1 from that string?

1 Like
local currentString = “number123”
local newString = string.sub(currentString,6,#currentString)

This might work, not sure yet, I’m on iPad right now.

4 Likes

Should be 7 (if you want to remove the sixth character). Additionally string.sub's third parameter defaults to the length of the subject string.

local str = "abcdefg"
str = string.sub(str, 7)
print(str) --g
2 Likes