Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java join if string is empty delimiter not used

String joined = 
    Stream.of(val1, val2, val3, val4)
          .filter(s -> s != null && !s.isEmpty())
          .collect(Collectors.joining(","));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #join #string #empty #delimiter
ADD COMMENT
Topic
Name
2+6 =