Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i gsub() the word before an specific word in a string?

Asked by 3 years ago

After reading the title, you are probably wondering what am i talking about. Heres an example:

local str = [[
local me = game:GetService("Players").LocalPlayer
local Mouse = me:GetMouse()
]]
--The word that i want to gsub is "me" but i don't want to do it manually, what i want to do is to get the word before ":GetMouse()" (which is "me") and then remove it.

How could i do this?

Answer this question