mIRC Home    About    Download    Register    News    Help

Print Thread
#44700 29/08/03 12:41 AM
Joined: May 2003
Posts: 2,265
P
pheonix Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
$replace(text,replace,with,N).
$replace($time,1,2,1) - will only replace the 1st match.
$replace($time,1,2,0) - will replace all matches.
i know its scriptable, i already have 1, but the code is messy and its not very fast.


new username: tidy_trax
#44701 29/08/03 12:47 AM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
I like the idea, but I'd say make it more like other mIRC N features. Meaning:

$replace(test,t,T,-1) would replace the last occurence
$replace(this is a test,t,T,1-2) would replace the first 2 occurences.

#44702 29/08/03 12:49 AM
Joined: May 2003
Posts: 2,265
P
pheonix Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
yeah that would be better, many a time i forget that it replaces all, so i use, ex: $replacecs($gettok($1-,1,33),b,B) then it does it for all occurences


new username: tidy_trax
#44703 29/08/03 07:17 AM
Joined: Dec 2002
Posts: 343
D
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 343
codemastr, like this?

$replace(string,substring,newsubstring,substring,newsubstring,N)

N being left out replaces all.

$replace(string,substring,newsubstring,substring,newsubstring,2-5) replaces 2nd through 5th.

$replace(string,substring,newsubstring,substring,newsubstring,2 3 7 -2 19-25) replaces the 2nd, 3rd, 7th, 2nd to the last, and the 19th through 25th.


Link Copied to Clipboard