I'm trying to find a string within v's Name and then return that string that was found but I don't know how to as I'm pretty sure string.find does not return a copy of the string.
local name = string.find(v.Name, ele[i])
Similar to string.match(), instead of returning the string, it returns the number position of the string, similar of the 2nd parameter to string.sub(). As in if I used.
local s1 = 'Potato' local s2 = 'tat' local s3,s4 = string.find(s1,s2) -- string, substring print(s3 , s4)
Instead of printing, a string, s3 would print 3, because that's where the function found the beginning of the smaller substring. s4 would print 5 because that's where the substring ended. Both s3 and s4 could return nil if the string does not contain a substring.