$remtok
From Scriptwiki
Revision as of 17:46, 9 May 2006 by Albie (talk | contribs) (Added example to remove a token from a varible)
Removes the Nth matching token from text.
$remtok(text,token,N,C)
Note that if you do not specify N, it will remove the first instance of the token you have specifed.
Example
echo -ag $remtok(This is a moo test,moo,1,32)
This echo's This is a test, as moo is removed from the text.
var %mytext = This word will remove a word var %token = word echo -ag $remtok(%mytext,%token,32)
This example will remove the first instance of the word word and so echos: This will remove a word.
var %mytoks = House Tree Bear Ship var %mytoks = $remtok(%mytoks,Tree,32) echo -ag Ours tokens are now: %mytoks
The above example shows how you can remove a token from a varible.