mIRC Home    About    Download    Register    News    Help

Print Thread
#206118 08/11/08 12:28 AM
Joined: Nov 2008
Posts: 22
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Nov 2008
Posts: 22
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.

Last edited by Firstmate; 08/11/08 12:29 AM.
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
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)


Link Copied to Clipboard