Answers for "stream collect to stringbuilder"

0

stream reduce stringbuilder

List<Person> list = Arrays.asList(
  new Person("John", "Smith"),
  new Person("Anna", "Martinez"),
  new Person("Paul", "Watson ")
);

String joinedFirstNames = list.stream()
  .map(Person::getFirstName)
  .collect(Collectors.joining(", ")); // "John, Anna, Paul"
Posted by: Guest on September-07-2020

Code answers related to "stream collect to stringbuilder"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language