Tuesday, March 30, 2010
Return a List of string and append/concat a List in C#
Got this from stackoverflow - http://stackoverflow.com/questions/1036829/how-to-return-list-of-strings-in-c
public static List<string> GetCities()
{
List<string> cities = new List<string>();
cities.Add("Istanbul");
cities.Add("Athens");
cities.Add("Sofia");
return cities;
}
To append to a List just do something like this
List<string> thumbnails = new List<string>();
thumbnails.AddRange(--------have a string array here--------------);
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment