G
Guest
I have a string of dates seperated by commas and I need to seperate them and
put them into a dropdown control. With the code below I am able to only
remove the comma which results in one big long string with no spaces and the
string is listed 5 time. How can I seperate the dates into seperate strings.
Here is the code I have so far:
string strDelim = ",";
char[] charDelim = strDelim.ToCharArray();
string Dates = StartDate;
string[] splitDates = null;
for (int x = 1; x <= 5; x++)
{
splitDates = Dates.Split(charDelim, x);
foreach (string s in splitDates)
{
SelectDate.Items.Add(s);
}
}
Thanks, Justin.
put them into a dropdown control. With the code below I am able to only
remove the comma which results in one big long string with no spaces and the
string is listed 5 time. How can I seperate the dates into seperate strings.
Here is the code I have so far:
string strDelim = ",";
char[] charDelim = strDelim.ToCharArray();
string Dates = StartDate;
string[] splitDates = null;
for (int x = 1; x <= 5; x++)
{
splitDates = Dates.Split(charDelim, x);
foreach (string s in splitDates)
{
SelectDate.Items.Add(s);
}
}
Thanks, Justin.