Skip to content
TG007 community snippet #60

$septok

Separates a string of text with the given character

By guest Added Jul 10, 2011 Updated Jul 10, 2011
General IRC All snippets
mIRC script 15 lines
About this snippet

Overview

Separates a string of text with the given character
Source code

mIRC script

15 lines · 398 characters
The C parameter is the ascii value of the character separating the tokens
Examples:
/septok <text> <C>
/septok abcdefghijklmnopqrstuvwxyz 32
//echo -a $septok(text,C)
//echo -a $septok(abcdefghijklmnopqrstuvwxyz,32)

alias septok {
  var %1 1
  while (%1 <= $len($$1)) {
    var %2 $instok(%2,$right($left($$1,%1),1),%1,$$2)
    inc %1
  }
  if (%2) $iif($isid,return %2,echo -a %2)
}
Community

Comments

Want to join the discussion? Sign in to TG007.
err0rSunday, 10 July, 2011
nice one