- String str="abcd";
- String[] strArr=str.split("");
-- 得到["","a","b","c","d" ]
请问如何写 split里的 正则 得到[ "a","d" ]
String str = "abcd中文ef"; String[] strArr = str.split("(?<!^)"); for (String s : strArr) { System.out.println("#" + s + "#"); } 输出: #a# #b# #c# #d# #中# #文# #e# #f#
原文链接:https://www.f2er.com/regex/362920.html