LastIndexOf to string gives me error

  • Thread starter Thread starter darrel
  • Start date Start date
D

darrel

This line:

response.write(mystring.LastIndexOf("\").ToString)

gives me this error:

mystring.LastIndexOf" to type 'Long' is not valid.
Microsoft.VisualBasic

why?

-Darrel
 
darrel said:
This line:

response.write(mystring.LastIndexOf("\").ToString)

gives me this error:

mystring.LastIndexOf" to type 'Long' is not valid.
Microsoft.VisualBasic

why?

I don't know about VB.NET, but in C# you'd need to escape the
backslash, like this:

myString.LastIndexOf("\\")

It doesn't really explain the error message (I'd need to know more VB)
but it's one potential avenue of enquiry.
 
I don't know about VB.NET, but in C# you'd need to escape the
backslash, like this:

myString.LastIndexOf("\\")

*sigh*. USER ERROR!

Yea, I kept finding references to the \\ in C#, but you don't have to do
that in VB since it's not an escape character.

But staring at my code a bit longer...it was an open-quote error. Just a
syntax goof on my part.

Oddly, the syntax goof sill made for a perfectly valid line of code in
Visual Studio, so I wasn't getting any syntax errors in my IDE.

-Darrel
 
Back
Top