Solved

whi this does not work?

Posted on 2004-03-31
3
219 Views
Last Modified: 2010-04-15
string test1 = "test";
                                          string test2 = "test";

                                          int test = test1.IndexOf(test2,0);


test = 0 ?
0
Comment
Question by:alain123
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
gillit earned 500 total points
ID: 10724993
It works.

0 means the beginning of the string.

t=0
e=1
s=2
t=3

It returns where the string starts the match.
0
 
LVL 3

Expert Comment

by:gillit
ID: 10725022
IndexOf("t",0) gives 0
IndexOf("t",1) gives 3
IndexOf("e",0) gives 1
IndexOf("e",1) gives 1
IndexOf("e",2) gives -1
0
 
LVL 1

Author Comment

by:alain123
ID: 10725098
got it, thanks..
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now