Reputation: 398
What would be the C# equivalent to the following:
Java:
String data = "dataString";
Collections.singletonList(data);
Specifically for the Collections.singleton(object) function. Thanks in advance.
Collections.singletonList
documentation description:
Returns an immutable list containing only the specified object. The returned list is serializable.
Upvotes: 0
Views: 315
Reputation: 57
This may solve your purpose.
var lst = Enumerable.Repeat(data,1);
Upvotes: 1