Code Snippets
Created: 2021-10-27
Edited: 2021-11-17
Some code snippets I don’t frequently enough to remember but needs every know an then.
C Sharp
Init List
private List<string> MyCars = new List<string>()
{
"BMW",
"Volkswagen",
"Volvo"
};
List To Comma Separated string
List<string> MyCars = new List<string>(){ "BMW", "Volkswagen", "Volvo"};
string cars = string.Join(",", MyCars);
// "BMW,Volkswagen,Volvo"