The example in this article describes how to convert a list and array in C #. Share to everyone for your reference. The specific analysis is as follows:
One, list to array (from list<string> to string[])
List<string> lists=new list<string> () lists.add ("str"); Lists.add ("Hello"); string[] Str=lists.toarray ( );
Second, array goto list (from string[] to list<string>)
string[] str={"str", "string", "abc"}; list<string> lists=new list<string> (str);
I hope this article is helpful to everyone's C # programming.
In addition to the Declaration,Running GuestArticles are original, reproduced please link to the form of the address of this article
Methods for converting between list and array in C #
This address: http://www.paobuke.com/develop/c-develop/pbk23144.html
Related Content C # An example of using FileStream to iterate through large file data A C # class that reads and writes a CSV file C # application Npoi get pictures from Excel, save to Local algorithm C # sqlhelper application Development Learning
In-depth parsing of generic classes in C # and generic interfaces C # download Web pages and methods in console output C # keyboard Mouse hook Instance C # implement compression, cropping operations instance for picture files
Methods for converting between list and array in C #