Thursday, January 04, 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, January 04, 2007 5:06:53 PM (Eastern Standard Time, UTC-05:00) | Comments [0] |  |  View blog reactions | del.icio.us#
Search
Archive
Links
Categories
Admin Login
Sign In
Blogroll
Themes
Pick a theme: