Solved

whi this does not work?

Posted on 2004-03-31
3
218 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
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…
This video discusses moving either the default database or any database to a new volume.

762 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

21 Experts available now in Live!

Get 1:1 Help Now