Hi,
I m currently working in VB .NET 2003.
I have the following string:
sBIG = "A final Goodbye from Greats"
I need to find whether the above word contains any word say "from".
I could not find a method in VB.net that can provide me the result.
Thanks,
Here's one way that will work
-
-
Dim sBIG As String = "A final Goodbye from Greats"
-
Dim intIndex As Integer
-
-
intIndex = sBIG.IndexOf("from", 0)
-
-
If intIndex <> -1 Then
-
lblDisplay.Text = "Your word is contained in this string"
-
-
End If
-
this code will search for whatever word you put in the parentheses after IndexOf.
If the compiler doesn't find your word in the string, then it will assign a value of -1 to the variable intIndex.
It is case sensitive so you could convert it to upper if you need to search for a word that might or might not contain capital letters.
Now, do you know how to populate a two dimensional array from a text file?
p.s. I didn't see that others have already answered your question.