mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2006
Posts: 546
J
jaytea Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
hi, duno if this has been requested before, but it'd be nice to see an identifier whose parameters resemble that of $mid but removed characters from a string

$rmid(string,3) = st
$rmid(string,4,1) = strng
$rmid(string,-4,2) = stng
$rmid(string,-4,-1) = stg

i.e. removes what $mid would normally return in those cases

maybe like $mid, if $3 = 0 it returns the number of chars left after the removal from position $2

i dont really need a scripted workaround, posting this more since i feel it would be a useful addition. i realize it's almost like a string equivalent to how $deltok handles tokens, which makes me wonder if it has in fact been previously considered. things like equivalents to $remtok ($remove the Nth/range occurence), $instok (insert a substring into a string at a position) might also be useful? and maybe one to overwrite text with given text at some position might be handy too? just throwing it out there ;D


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
This could be useful, agreed. I don't think it should be called $rmid though. Maybe something like $rsubstr (remove substring).

Joined: Oct 2003
Posts: 88
B
Babel fish
Offline
Babel fish
B
Joined: Oct 2003
Posts: 88
This could be useful especially when you consider the problems you would run into creating a custom alias that handled spaces correctly. That is to say that the solution is more complicated than:

Code:
$+($left(%var,4),$right(%var,-6))


Basicer - Windows 7 Business x86

Link Copied to Clipboard