how to check a particular word in a text file is available using vb.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mary dayana
    New Member
    • Feb 2012
    • 3

    how to check a particular word in a text file is available using vb.net

    i have stored all the elements in a xml file in a text file.i dont want to store all the elements but the distinct values,hence kindly reply
  • !NoItAll
    Contributor
    • May 2006
    • 297

    #2
    Code:
    Dim sText as String = my.computer.filesystem.readalltext(myfilename)
    'case sensitive search
    If sText.contains(myString) then
       'it is in there
    Else
       'it is not in there
    End if
    'case insensitive search
    If sText.ToLower.Contains(myString.tolower) then
       'it is in there
    Else
       'it is not in there
    End if

    Comment

    Working...