Strip a string
by Erik Madison · in Torque Game Engine · 09/12/2004 (11:23 am) · 3 replies
I need to strip out part of a string, but in script.
ie, string = "Inventory3", I need a new string to be "3". What I'm stripping is constant and known, the remainder is not.
Help?
ie, string = "Inventory3", I need a new string to be "3". What I'm stripping is constant and known, the remainder is not.
Help?
About the author
Torque Owner Russell Tracey
%outstring = StripChars(%instring,"Inventory");
echo(%outstring); // 3
StripChars will strip *all* occurances of the second argument so:
if %instring = "Inventory3Inventory"; %outstring would be "3"