Solved

whi this does not work?

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# Single Form 8 42
C# MVC and a global static factory that never dies 4 57
Install Problem 13 29
Getting error in connectionstring with Excel. 30 30
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
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…

813 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

12 Experts available now in Live!

Get 1:1 Help Now