Difference between revisions of "$remtok"

From Scriptwiki
Jump to: navigation, search
(not ready but want to save it)
 
Line 2: Line 2:
 
  $remtok(text,token,N,C)
 
  $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 ==
 
== Example ==
 
  [[echo]] -ag $remtok(This is a moo test, moo, 1, 32)
 
  [[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.
 
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''.
 +
 
[[Category:Token Identifiers]]
 
[[Category:Token Identifiers]]
 
{{Stub}}
 

Revision as of 22:13, 25 November 2005

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.