Possible Duplicate:
Convert array of strings to List<string>
I am new to C#
How to copy entire string of array to List?
i have tried this but i didn’t get any solution.
List<string> lstArray = strArray.toList<string>;
or
List<string> lstArray = new List<string>();
strArray.copyTo(lstArray,0);
Pass string array in list constructor.
The reason your first line didn’t work was because you are not using the correct syntax. So instead of
Use
or
For the 2nd option where you are trying to use Array.CopyTo, it works with array types, not generic list. You are probably getting the error.
Since it expects an array and you are passing a generic list.