If I have a string like this.
local string = "D:/Test/Stuff/Server/resources/[Test]/SuperTest"
How would I remove everything after the word "server" so it will end up look like this
local string = "D:/Test/Stuff/Server"
If I have a string like this.
local string = "D:/Test/Stuff/Server/resources/[Test]/SuperTest"
How would I remove everything after the word "server" so it will end up look like this
local string = "D:/Test/Stuff/Server"
use str instead of string to not shadow the real string library
local str = "D:/Test/Stuff/Server/resources/[Test]/SuperTest"
here a solution
str = str:match("(.*Server)")
or use do...end to avoid shadowing
do
local string = ("D:/Test/Stuff/Server/resources/[Test]/SuperTest"):match("(.*Server)")
end