Example Set 2: - String -"Todays India" Find the value "in"
' Position Value is 8 for "in"
MsgBox "Position of ""in"" is "& Instr(1,"Todays India","in",vbTextCompare)
' Returns Position Value 8
MsgBox "Position of ""In"" is "& Instr(1,"Todays India","In",vbTextCompare)
' Returns Position Value 0
MsgBox "Position of ""in"" is "& Instr(1,"Todays India","in",vbBinaryCompare)
' Returns Position Value 8
MsgBox "Position of ""In"" is "& Instr(1,"Todays India","In",vbBinaryCompare)
Example Set 2: Change Start position of Compare Text
' Returns 6
MsgBox InStr(1,"Moni Ajith Kumar","Ajith")
' Returns 0 -
MsgBox InStr(7,"Moni Ajith Kumar","Ajith")
Nice explanation with example!!!
ReplyDeleteQTPbook