LastIndexOf to string gives me error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • darrel

    #1

    LastIndexOf to string gives me error

    This line:

    response.write( mystring.LastIn dexOf("\").ToSt ring)

    gives me this error:

    mystring.LastIn dexOf" to type 'Long' is not valid.
    Microsoft.Visua lBasic

    why?

    -Darrel


  • darrel

    #2
    Re: LastIndexOf to string gives me error

    I don't know about VB.NET, but in C# you'd need to escape the
    backslash, like this:
    >
    myString.LastIn dexOf("\\")
    *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


    Comment

    Working...