Difference between revisions of "$deltok"

From Scriptwiki
Jump to: navigation, search
m (tweaking)
 
Line 1: Line 1:
Deletes the Nth token from text.
+
Deletes the Nth token from text or a range of tokens.
 
  $deltok(text,N-N2,C)
 
  $deltok(text,N-N2,C)
  
Line 5: Line 5:
  
 
== Example ==
 
== Example ==
  [[echo]] -ag $deltok(This is a moo test,4,32)
+
  [[echo]] -a $deltok(This is a moo test,4,32)
This example will echo ''This is a test'', as ''moo'' is removed from the text.
+
This example will echo ''This is a test'' to your active window, as ''moo'' is removed from the text.
  [[echo]] -ag $deltok(This is a test for you,-2-1,32)
+
  echo -a $deltok(This is a test for you,-2-1,32)
 
This example will also echo ''This is a test'', as the last two words are removed from the text.
 
This example will also echo ''This is a test'', as the last two words are removed from the text.
  
 
[[Category:Token Identifiers]]
 
[[Category:Token Identifiers]]

Latest revision as of 13:52, 27 February 2006

Deletes the Nth token from text or a range of tokens.

$deltok(text,N-N2,C)

Note that you can specify a negative value for N.

Example

echo -a $deltok(This is a moo test,4,32)

This example will echo This is a test to your active window, as moo is removed from the text.

echo -a $deltok(This is a test for you,-2-1,32)

This example will also echo This is a test, as the last two words are removed from the text.