java – 如何用||拆分字符串
发布时间:2020-12-15 05:18:26 所属栏目:Java 来源:网络整理
导读:参见英文答案 Splitting string with pipe character (“|”) ????????????????????????????????????5个 当我拆分字符串时: “EMP ID||EMP NAME||DESIGNATION” 我把每个字母分开: [,E,M,P,I,D,|,N,A, M,S,G,T,O,N] 我的代码是 String strHeader="EMP ID||
参见英文答案 >
Splitting string with pipe character (“|”) ????????????????????????????????????5个
当我拆分字符串时:
我把每个字母分开:
我的代码是 String strHeader="EMP ID||EMP NAME||DESIGNATION"; String[] arrStrColumnsInRow=strHeader.split("||"); 我怎样才能将它拆分为:
解决方法
使用
String[] arrStrColumnsInRow=strHeader.split("||"); 这是因为 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |