Results 1 to 3 of 3

Thread: InStr function...

  1. #1

    Thread Starter
    Hyperactive Member vbzero's Avatar
    Join Date
    Aug 2000
    Location
    Vienna
    Posts
    347

    Question InStr function...

    Does anybody know if there's a function like "InStr" as it is
    in VB or VB.NET?

    thx!

  2. #2
    BG
    Guest
    I'd start out looking in the System.String class first. If you don't figure it out by the time my other comp is put back togeather I post a sample. I don't have any of my code on this pc.

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    sont know if this is the correct syntax, but it should be

    string yourstring = "Apple";

    int instringnumber = yourstring.IndexOf("A");


    IndexOf is the correct method, just dont know if the the parameter is correct, but it should be that.

    You also have LastIndexOf which will get the index of the the last occurance. FYI
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width