Results 1 to 2 of 2

Thread: find in string

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    find in string

    is there a function in C# to find a particular piece of text in a string? I have tried substring but returns false no matter what i give it...

    thanks!

  2. #2
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    If you're looking for something like VB instr:
    Code:
    string myString = "Hello Techno";
    int i = myString.IndexOf("Techno");
    MessageBox.Show(i.ToString()); // Displays "6"

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