List<String> stringList0 = new ArrayList<String>();
stringList0.add("aaa");
stringList0.add("bbb");
System.out.println(stringList0.toString());
// [aaa, bbb]
List<String> stringList1 = Lists.newArrayList("aaa","bbb");
System.out.println(stringList1.toString());
// [aaa, bbb]
List<String> stringList2 = Arrays.asList("aaa,bbb".split(","));
System.out.println(stringList2.toString());
// [aaa, bbb]
List<String> stringList3 = Arrays.stream("aaa,bbb".split(",")).map(e->{return e+"aaa";}).collect(Collectors.toList());
System.out.println(stringList3.toString());
// [aaaaaa, bbbaaa]
String str0 = Arrays.stream("aaa,bbb".split(",")).map(e->{return e+"aaa";}).collect(Collectors.joining(","));
System.out.println(str0);
// aaaaaa,bbbaaa
String str1 = Lists.newArrayList("aaa","bbb").stream().map(e->{return e+"bbb";}).collect(Collectors.joining(","));
System.out.println(str1);
// aaabbb,bbbbbb
// 以下都是 true
System.out.println(StringUtils.isBlank(null));
System.out.println(StringUtils.isBlank(""));
System.out.println(StringUtils.isBlank(" "));
System.out.println(StringUtils.isBlank(" "));
System.out.println(StringUtils.isBlank("\n \r \t \f"));
网友评论