Lets say I have two values, "Baby", and "Dog". What I want to do is find both of those strings in one name in lighting, as in "Baby Dog". The thing is, I don't know how to find certain letters in strings to be able to do this.
You just use string.match
. It matches strings. If it finds a match, it returns that match; otherwise it returns nil.
local str = "Baby Dog" print( str:match("Baby") ) --> Baby print( str:match("qwerty") ) --> nil
You can also use string patterns for less specific matching.