// 1、字符串变字符数组:split
String s = “a b c b d”;
String[] strs = s.split(" "); // strs[0] = "a" strs[1] = "b" ...
// 2、集合变字符串:String.join
ArrayList<String> arrList = {{"a"},{"b"},{"c"}};
String s = String.join(" ",arrList); // s = "a b c";
Java有用的API
最新推荐文章于 2024-10-05 12:07:50 发布