zoukankan
html css js c++ java
(转)ArrayList 与 string[] 的转换
ArrayList 与 string[] 的转换
Method1:
Code
public
string
[] ToArray
ArrayList list
=
new
ArrayList();
list.Add(
"
aaa
"
);
list.Add(
"
bbb
"
);
//
转换成数组
string
[] arrString
=
(
string
[])list.ToArray(
typeof
(
string
) ) ;
Method2:
Code
ArrayList list
=
new
ArrayList();
list.Add(
"
aaa
"
);
list.Add(
"
bbb
"
);
//
转换成数组
string
[] arrString
=
new
string
[list.Count];
for
(
int
i
=
0
; i
<
list.Count ; i
++
){
arrString[i]
=
list[i].ToString();
}
将string转换成ArrayList类型:
Code
string
str
=
"
1,2,3,4,5
"
;
ArrayList b
=
new
ArrayList( str.Split(
'
,
'
) ) ;
查看全文
相关阅读:
Uva 10719 Quotient Polynomial
UVa 11044 Searching for Nessy
Uva 10790 How Many Points of Intersection?
Uva 550 Multiplying by Rotation
Uva 10916 Factstone Benchmark
Uva 10177 (2/3/4)D Sqr/Rects/Cubes/Boxes?
Uva 591 Box of Bricks
Uva 621 Secret Research
Uva 10499 The Land of Justice
Uva 10014 Simple calculations
原文地址:https://www.cnblogs.com/fjchenqian/p/1386197.html
最新文章
使用truss、strace或ltrace诊断软件的"疑难杂症"
qmake notes
svn notes 2
纯虚函数使你不能定义对象。
libmeegotouch的程序打开debug
qt 点滴
Qt designer和uic qt's user interface compiler
C# .net中cookie值为中文时的乱码解决方法
批量更新日期字段中的年
C#编程规范
热门文章
Asp.Net把word文件转换为html文件
域名/IP反解析
最简单的方法解决div被select遮挡的问题
2003应用池假死常见问题和解决方法
【转】 sqlserver 异地备份
sql server 中去掉不安全的扩展存储过程
SQLSERVER触发器
Uva 253 Cube painting
Uva 10970 Big Chocolate
Uva 846 Steps
Copyright © 2011-2022 走看看