mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2005
Posts: 28
G
Godlike Offline OP
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jan 2005
Posts: 28
I have a text in a variable how can i strip all codes from it...

bold,color,underline....

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
$strip(%var)


New username: hixxy
Joined: Jan 2005
Posts: 28
G
Godlike Offline OP
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jan 2005
Posts: 28
How can i use this forward then?

or can i use this already in /set cmd ?

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
If you want to set the new contents of %var to the old contents with no colour codes, use this:

Code:
//set %var $strip(%var)


New username: hixxy
Joined: Jan 2005
Posts: 28
G
Godlike Offline OP
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jan 2005
Posts: 28
thx works....

One more thing i have in %var like this

[word] how can i throw away those [], but when i get the something to the var it`s not always same length it could be also [something] and i would like only that something out of it...

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
//set %var $mid(%var,2,$calc($len(%var) - 2))


New username: hixxy
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Code:
$mid(%var,2,-1)


Good old negative indices.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Ah, I knew $left and $right supported negative indexes but I wasn't sure about $mid, thanks.


New username: hixxy

Link Copied to Clipboard