How to make a script that finds words used in a string from a table and then replaces the words with new one?
Here's my attempt:
local stringtofind = {'are', 'you'}
local stringtoprocess = 'i think you are cool'
local startvalue,endvalue = string.find(stringtoprocess,stringtofind)
local firststring = string.sub(stringtoprocess,1,startvalue-1)
local secondstring = string.sub(stringtoprocess,endvalue+1,string.len(stringtoprocess))
local stringtoinsert = "you're"
local processedstring = firststring .. stringtoinsert ..secondstring
print(processedstring) -- i want it to print "i think you're cool"
Any help?

2 comments
string.gsub(string, thingToReplace, thingToReplaceItWith) should do what you're looking for
You can pass dictionaries through gsub