Thursday, 04 January 2007

This is something that I tend to forget even though it's pretty basic and probably obvious to most.  I have a comma delimited string which I wanted to put into a List<>.  Here's a one-liner to get the job done.

   List<string> aList = new List<string>();
  aList.AddRange(myString.Split(','));

Where myString is my comma-delimited string.  Pretty basic, but very handy.

Thursday, 04 January 2007 10:06:53 (Eastern Standard Time, UTC-05:00) | Comments [0] | .NET#
Search
Archive
Links
Categories
Admin Login
Sign In
Blogroll
Themes
Pick a theme: