InStr and InstrRev

85 views
Skip to first unread message

kishore kumar

unread,
Nov 11, 2014, 1:00:33 PM11/11/14
to mercu...@googlegroups.com

 Hi there,

Can any one explain me briefly about Instr and InstrRev in vbscript with examples....

thanks,
-kishore

Ashish Gupta

unread,
Nov 11, 2014, 5:59:41 PM11/11/14
to mercu...@googlegroups.com
Instr is to find the a string into pattern of string
Example :

Thanks,
Ashish gupta
Gurgaon,Haryana

--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

---
You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mercuryqtp+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cintia Lopes Martins

unread,
Nov 11, 2014, 5:59:42 PM11/11/14
to mercu...@googlegroups.com

Lakshya Tyagi

unread,
Nov 12, 2014, 12:14:57 AM11/12/14
to mercu...@googlegroups.com
Hi 

InStr -  This function returns the Position of a sub- string within a Big string, considering First letter of Big string from left as starting Position 1.
InStrRev - This function returns the Position of a sub- string within a Big string, considering First letter of Big string from the Right as starting Position 1.

Regards
Laksh

Akhalesh Yadav

unread,
Nov 12, 2014, 3:01:44 AM11/12/14
to mercu...@googlegroups.com
Hi,
     Instr - it returns the position of the occurance of sub string in main string, it begins from start of the string.
            a=instr("akhalesh lession","les")   it returns 5 
     InstrRev - It returns also the position of the occurance of sub string in main string but it begins from end of the string.
           b=instrrev("akhalesh lession","les")   it returns 10


Thanks..
Akhalesh

--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

---
You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mercuryqtp+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

vengatesh G

unread,
Nov 12, 2014, 7:08:27 PM11/12/14
to mercu...@googlegroups.com
Hi,

Instr function :

Returns the position of the occurrence from one string with another.
Ex : msgbox instr("welcome","c") Result : 4

InstrRev function:

Returns the position of the occurrence from one string within another frm end of string
Ex : msgbox instrrev("welcocme","c") Result : 6

Conclusion : Instrrev started searching c from fromend of string e and first occurrence of c will be at 6th position.

Thanks,
Vengatesh

--
Reply all
Reply to author
Forward
0 new messages