As can be seen from here
http://msdn.microsoft.com/en-us/library/8460tsh1(v=vs.90).aspx[
^],
InStr
is a
VisualBasic
specific
Shared
function, which returns the first occurance of one string in another string. The
start index is 1 based
. It returns
0
in case of
non finding
the string.
As can be seen from here
http://msdn.microsoft.com/en-us/library/k8b1470s.aspx[
^] the,
IndexOf
is
an instance method of string
class of .NET framework and can be used
in VB and C#.
The
start index is 0 based
and returns
-1
in case of non finding the string.
The examples for usage of the above functions are given at the above references.
I think the
IndexOf
method is good to use as it is common for all .NET languages.