Let’s say i have a phrase “Slot14538432”
How can i get the “Slot1” out of it?
2 Likes
local aString = "Slot14538432"
local bString string.match(aString, "Slot1")
local cString = string.sub(aString, 1, 5)
1 Like
Is there a way to like get the first 5 letters out of the phrase instead of me having to specify what i want to get?
local cString = string.sub(aString, 1, 5)
That’s what this line of code does. Truncates the specified string down to the first 5 characters.