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(
'
,
'
) ) ;
查看全文
相关阅读:
curl 空格和转义符
supervisor
pandas 小笔记
bert 进行文本相似度计算
认股权证的会计处理
企业所得税汇算清缴
调整事项与非调整事项的区别
centos 挂载windows 2003 smb
如何获得带转义的json内容
安装了vs2019 编译node-sass node-gyp 找不到编译器的解决方法
原文地址:https://www.cnblogs.com/fjchenqian/p/1386197.html
最新文章
内网ntp时间同步配置
CentOS7 Zabbix3.4安装
centos7 LNMP
nginx日志相关的查询
zabbix存储history_text
用python爬取租房网站信息的代码
你知道游戏外挂,但是知道用Python也能做外挂不?
干货I Python 爬虫:8 个常用的爬虫技巧总结!
哔哩哔哩播放量达700万次python教程,这套“码神”无偿分享哦
python与excel的关系;铁打的python流水的excel
热门文章
30道+python3的基础练习题—速度收藏
Python微信库:itchat的用法详解
新人在纠结!PHP与Python语言学哪一个比较好?看完这个你就知道怎么选择了
超级大神珍藏的Python初学者最详细学习路线图分享
26道大题python实战练习-习题
python 获取时间
str.contains 如果遇到空值
使用timeit进行性能测试
使用siege进行压力测试
pandas 列名重命名
Copyright © 2011-2022 走看看