TriggerRegisterPlayerChatEvent is NOT case sensitive, and as said by UndeadXAssasin, the TRUE at the end meaning its an exact match. If you look at JJ's CP it says False at the end, and the string is "-". So each time you write a word that contains the character "-" it checks for your cheats.
On another note. GUI is not case-sensitive because it uses TriggerRegisterPlayerChatEvent for EVERY single command. Thats why it takes 20 triggers for 20 commands, while if you know jass you can do it in 1 trigger (like JJ's CP does).
Now for substring. Lets look at the following code.
Code:
function X takes nothing returns nothing
local string chat="-Gold"
local string command="-gold"
if chat==commands then
//give gold
endif
endfunction
Lets say that you entered the word "-Gold" (the variable called "chat") it won't match the command as it is "-gold" even if logicaly G=g, its a computer, and it sees the following:
Code:
if "-Gold"=="-gold" then
You can see they are NOT a match. So how do we fix the problem? Well JASS has a built in command if you want it NOT case-sensitive.
Code:
function X takes nothing returns nothing
local string chat=StringCase("-Gold",false)
local string command="-gold"
if chat==commands then
//give gold
endif
endfunction
What StringCase does, it takes a string (first paramter) and turns all its characters to either upper (true) or lower (false) case characters (second parameter). So now "-Gold" is set to "-gold".
Hope that clears things out.