mIRC Homepage
Posted By: sorex instr - 29/06/03 04:15 AM
Hello,

is there some sort of instr function to determin where in a string a specific character or text is?

i mean this

set %xpos = instr($1,"test")
/msg $me $right($1,$len($1)-xpos)

to give " string" where the inpunt was "this is a test string"
Posted By: ScatMan Re: instr - 29/06/03 04:38 AM
i think u meant $pos
//echo -a $pos(this is a test string,string)
will return the position of "string" in the text which is 16
Posted By: sorex Re: instr - 29/06/03 05:38 AM
thanks, that's what I was after

any idea how you can use a double quote inthere?

$left($1-,$calc($pos($1-, " text,1)))
Posted By: ScatMan Re: instr - 29/06/03 05:57 AM
of course u can, it's not like in other languages that u have to put a string inside quotes

Posted By: sorex Re: instr - 29/06/03 06:02 AM
when i do this i get nothing

echo 5 # $pos($1-," )

it doesn't seem to handle double quotes
Posted By: Collective Re: instr - 29/06/03 06:05 AM
//echo -a $pos(lalala"aaa,") works fine for me..
Posted By: sorex Re: instr - 29/06/03 06:56 AM
thanks again, small typo in my code blush
© mIRC Discussion Forums