Solved

whi this does not work?

Posted on 2004-03-31
3
224 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

752 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