mIRC Homepage
Posted By: Firstmate A token identifier - 08/11/08 12:28 AM
Is there (if not, can someone please help make me one) a token identifier that inserts a token between each character.
e.g. %words = This is a test message
And then using some sort of identifier, $insertok(%words,44)
And would then return: T*h*i*s i*s a t*e*s*t m*e*s*s*a*g*e

And if possible, exclude putting a C (In the example above a 44, or *) in spaces.

P.s. Note how the example doesn't put *'s in front or end of words.
Posted By: Horstl Re: A token identifier - 08/11/08 12:52 AM
There is none, and I won't call it "tokens" smile But I hope that's what you want:

Code:
alias insert { 
  var %d = $chr($$2)
  return $regsubex($1,/(?<=\S)(\S)/g,%d $+ \1))
}


//var %text = This is a test message | echo -a $insert(%text,42)
returns:
T*h*i*s i*s a t*e*s*t m*e*s*s*a*g*e

(Note that "asterisk" has ascii value 42, not 44)
© mIRC Discussion Forums