Hi All
I have a listbox with a list like below
1. 05/7/11
2. 05/07/11
3. 09/8/11
4. 05/11/11
Using the code below that shuld check for a single digit month
string regExp1 = "(?
string arr;
for (int a = 0; a < 99; i++)
{
arr = arrStrUSA[a];
if (arr == regExp1)
{
arr.Insert(4, "0");
listBox2.Items.Add(arr);
}
else
{
listBox2.Items.Add(arr);
}
}
I thought I could iterate through the listbox adding a 0 to the front of the ones with a single digit for a month but nothing comes.
What I need to do is add 0 to line 1, 3 so they look like lines 2, 4
then delete "
Thanks in advance
Mike
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Apr 21, 2012, 8:55 AM
http://www.c-sharpcorner.com/Forums/Thread/169439/trouble-with-lilstbox-and-arrays.aspx