KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am writing my testcode and I do not want wo write: List<string> nameslist = new List<string>(); nameslist.Add("one"); nameslist.Add("two"); nameslist.Add("three"); I would love to write List<string> nameslist = new List<string>({"one", "two", "three"}); However {"one", "two", "three"} is not an "IEnumerable string Collection". How can I initialise this in one line using the IEnumerable string Collection"?
Tags (comma-separated)
Save Edits
Cancel