String[] strs = {"aaa","bbb"};
String join = TextUtils.join(",", strs);
assert join.equals("aaa,bbb");
List<String> lists = new ArrayList<>();
lists.add("ddd");
lists.add("eee");
String joinList = TextUtils.join(",", lists);
assert joinList.equals("ddd,eee");
Android拼接字符串的另一种方法TextUtils.join()
最新推荐文章于 2022-05-18 18:03:54 发布