Searching a particular text
-
can any tell me how simplest of way to find whether a string exists in a file. for eg.I have file tat ends with "}" I have to close the file ,if tat exists Thanks in advance
-
can any tell me how simplest of way to find whether a string exists in a file. for eg.I have file tat ends with "}" I have to close the file ,if tat exists Thanks in advance
-
can any tell me how simplest of way to find whether a string exists in a file. for eg.I have file tat ends with "}" I have to close the file ,if tat exists Thanks in advance
if yourstring.contains("yourchar") then
-
if yourstring.contains("yourchar") then
actually i want to open a file and search if "}" exists.
-
actually i want to open a file and search if "}" exists.
dim textreader as textreader (or somthing like that ;P) do while not textreader.EOF dim s as string = textreader.readline if s.contains("}")then 'do somthing end if loop
-
dim textreader as textreader (or somthing like that ;P) do while not textreader.EOF dim s as string = textreader.readline if s.contains("}")then 'do somthing end if loop
Unless your file turns out to be very big, you could simplify a lot and use File.ReadAllText method. :)
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
-
can any tell me how simplest of way to find whether a string exists in a file. for eg.I have file tat ends with "}" I have to close the file ,if tat exists Thanks in advance
dim s as string = system.io.file.readalltext("C:\Example") if s.contains("}") then 'do your actions end if
Please check out my articles: The ANZAC's articles