I am trying to figure out how to remove a word from string. I tried using string.sub but don't know what to do from there.
local String = "Buy Model" if string.sub(String, 1, 4) == "Buy " then --I know you can do String = string.sub(String, 5, 8) but there is multiple strings I want to remove "Buy " from end
I found one way to do it:
local String = "Buy Model" if string.sub(String, 1, 4) == "Buy " then local stringLength = string.len(String) String = string.sub(String, 5, stringLength) print(String) -- prints 'Model' end