Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27046

VS 2012 [Resolved] IndexOf Text in Quotations

$
0
0
I'm trying to find the index of "some text", including the quotations. I've tried a few ways to escape the quotations but all have failed, resulting in an index of -1

Example...
Code:


Dim txtFile as String
Dim txtIndex as Integer

txtFile = 'Some text file

txtIndex = txtFile.IndexOf(Chr(34) & "some text" & Chr(34)) ' Index = -1, failed.
txtIndex = txtFile.IndexOf("""some text""") ' Index = -1, failed.

Is there anyway to get the index of a text that contains quotes?



Thanks,
-Chris

Viewing all articles
Browse latest Browse all 27046

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>