Subject: instr function
Posted By: Beulah Post Date: 9/16/2003 2:06:46 AM
hi,

any function in C# that is equivalent to instr or instrRev?
Thx
Reply By: planeswalk Reply Date: 9/18/2003 1:54:15 AM
Hi,

You can use the IndexOf method of the String class.  It returns the index (integer) of the first occurence of a substring, like so.

  String str = "teststring";
  Int32 i = str.IndexOf("string");

In this case, i will return a value of 4.

Cheers!


Marlon Villarama
Support Team
Web Burner Hosting
marlon@webburner.com
www.webburner.com
Toll-Free: 877-535-2876



Go to topic 4147

Return to index page 1044
Return to index page 1043
Return to index page 1042
Return to index page 1041
Return to index page 1040
Return to index page 1039
Return to index page 1038
Return to index page 1037
Return to index page 1036
Return to index page 1035