I tried this above but then it just never ended, I want all the characters before the :'s to be removed so it’s just “:1: Wow” but the “aDajD” at the start will be randomized so I can’t just use gsub, and it’s at a randomized length aswell so you can’t exactly sub it either
And yes I realised that the code would never reach “:” because I set it to the first character
For that, you do not need to have a loop to achieve your desired outcome. Instead you can find the index of the occurrence of the string you want to be the first letter:
local firstChar = ":"
local function Sub(str)
return string.sub(str, string.find(str, firstChar), -1)
end
If you read the post carefully, he wants the colon to be the first character of the string. Using string.split will return the characters after the colon which is not desired. Also, in a string like this: “aDajD:1: Wow”, your method will return “1” since there’s another colon in the string which means string.sub is the way to go