Jelly2003 Posted August 3, 2004 Share Posted August 3, 2004 I'm trying to set up an enumerator as follows: > I have a string that is set to: "jan;feb;mar;apr;jun;jul;aug;sep;oct;nov;dec;" > I want the enumerator to covert the above string into an array containing the short month names, such as "jan", "feb", "mar", etc I just can't figure out how to tell the Enumerator object that " ; " is the symbol that seperates each value in the list. Can anyone tell me what i need to do to get the enumerator object to recognise " ; " as the item seperator. Thanks. Link to comment Share on other sites More sharing options...
0 azcodemonkey Posted August 4, 2004 Share Posted August 4, 2004 You want to use the Split method of the string object passing in ';' as the delimiter. string[] months = yourMonthString.Split( ';' ); Link to comment Share on other sites More sharing options...
0 Jelly2003 Posted August 4, 2004 Author Share Posted August 4, 2004 Thanks, that worked perfectly! Link to comment Share on other sites More sharing options...
Question
Jelly2003
I'm trying to set up an enumerator as follows:
> I have a string that is set to: "jan;feb;mar;apr;jun;jul;aug;sep;oct;nov;dec;"
> I want the enumerator to covert the above string into an array containing the short month names, such as "jan", "feb", "mar", etc
I just can't figure out how to tell the Enumerator object that " ; " is the symbol that seperates each value in the list.
Can anyone tell me what i need to do to get the enumerator object to recognise " ; " as the item seperator.
Thanks.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts