标签:[] 之间 转换 ring oar string转换 type inf get
1、ArrarList 转换为 string[] :
ArrayList list = new ArrayList();
list.Add("aaa");
list.Add("bbb");
string[] arrString = (string[])list.ToArray(typeof( string)) ;
2、string[] 转换为 ArrarList :
ArrayList list = new ArrayList(new string[] { "aaa", "bbb" });
3、ArrayList 转换为 string :
ArrayList list = new ArrayList();
list.Add("aaa");
list.Add("bbb");
string str= string.Join(",", (string[])list.ToArray(typeof( string)));
4、string 转换为 ArrayList :
string str="1,2,3,4,5";
ArrayList b = new ArrayList( str.Split(‘,‘) ) ;
5.string转换成list<string>
string RequestInfo = prms.GetPrmsInfo("RequestInfo", "") as string;
List<string> insertList = RequestInfo.Split(‘,‘).ToList<string>();
ArrayList、string、string[]之间的转换
标签:[] 之间 转换 ring oar string转换 type inf get
原文地址:http://www.cnblogs.com/free89-10-15/p/6011786.html