I am converting my .js list to c#. This is what I have:
List<string> allflipping = new List<string>["020-030-031","032-033-023","013-003-002","001-000-010"];
And I get this error:
error CS0029: Cannot implicitly convert type `string' to `int'
I googled and cannot find answer that can make it work. How can I resolve this?
It's not clear why you've put that in square brackets. It's as if you're trying to create an array of List<string>
, using your strings as the size of the array.
I suspect you meant to use a collection initializer with curly braces:
List<string> allflipping = new List<string> {
"020-030-031", "032-033-023", "013-003-002", "001-000-010"
};
See more on this question at Stackoverflow