Quote from PhanxIf you have a variable containing a string:
local myVar = "Hello world"
You can check if the value matches another string exactly:
if myVar == "Hello world" then
...or you can check if the value matches a Lua pattern:
if string.match(myVar, "$Hello") then
Basically, as Tekkub said, if you simply need to check for an exact match between two strings, use ==. If you need to match against a pattern (regexp), use string.match.
if string.match(lootString, $UnitName("player"))
local lootString = "XYZ receives loot: [blah blah]"
if string.find(lootString, UnitName("player")) then