Click here to Skip to main content
13,052,033 members (38,130 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I don't don't really know how, this is my half attempt on it, its oboiusly doesn't work

int addnumber = 0;
       while (addnumber < Properties.Settings.Default.DatesEventNames.Count)
           addnumber = addnumber + 1;
               DateTime yourDateTime = DateTime.ParseExact(item, "ddMMyyyy", CultureInfo.InvariantCulture);

Lets say I have a string collection with this in it

hi<br />
hi2<br />
hi3<br />

and i just want to see h3 in my textbox, and not really all of them, I want to be able to read the line by the line number not


so I dont want the contains string method, I want the method that it kinda like

In (stringcollection.linenumber == 3)
textbox.text = the string's text on that line number

and that would be "hi3". can anyone please help me out with this?
Posted 6-Jan-13 19:38pm
Updated 6-Jan-13 19:51pm
Suvabrata Roy 7-Jan-13 1:50am
I did not understand what is your problem ...
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You have a collection, you can access it by index. myStringCollection[3]. Also, you can use a dictionary if you want to use a non sequential index to access an item
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Hi Tech,
i just made a sample for your help....may be it can help u

ArrayList list = new ArrayList();
       foreach (string item in list)

           int index=item.LastIndexOf('3');
           if (index==2)//**also u can use (index>1)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 7 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100