惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - 在下刚哥

ABP配置时间格式 Java Instant\Date\LocalDateTime\Calendar\ZonedDateTime转化 - 在下刚哥 - 博客园 Json转换 黑龙江社保电话 List与String的相互转换(C#) ServiceStack.Redis的GetTypedClient C# 16进制转换10进制 揭秘人体24小时 四年一轮回 .cs编译DLL类库方法 类命名规范、数据库命名规范和页面文件命名规范 SHTML和HTML的区别 NavigateUrl属性绑定 - 在下刚哥 - 博客园 让IT工作者过劳的13个坏习惯 腾讯笔试题--国王招来100个囚犯(转) 很牛的求职经历(转) 中国各城市经纬度数据 Microsoft Visual Source Safe 2005 下载地址 Fckeditor在.net下用验证控件问题
List与String、数组的相互转换
在下刚哥 · 2022-01-05 · via 博客园 - 在下刚哥

String 转 List<Long>

String string = "1, 2, 3, 4";
List<Long> list = Arrays.asList(string.split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());

List<Long> 转 String

String str = Arrays.toString(listIds.toArray());   //[1,2,3,3,4]

List<String> list = new ArrayList<>(2);
list.add("guan");
list.add("bao");
String[] array = list.toArray(new String[0]);

String[] str = new String[] { "yang", "hao" };

List list = Arrays.asList(str);

仍然为数组,不可使用add/remove/clear方法。