Case insensitive string replace. (better than Clockturn's)Code: [Select]function striReplace(%str, %find, %replace){ %str = strReplace(%str, strUpr(%find), %replace); %str = strReplace(%str, strLwr(%find), %replace); return %str;}
function striReplace(%str, %find, %replace){ %str = strReplace(%str, strUpr(%find), %replace); %str = strReplace(%str, strLwr(%find), %replace); return %str;}
striReplace("Hello world", "hello", "goodbye cruel")
A friend found me this GarageGames thread on OOP yesterday. It demonstrates a simple way to create something similar to a class (and instances of) in TorqueScript. This really helped me with the project I was working on; storing everything in "arrays" gets frustrating sometimes!
I recommend Notepad++