stream reduce stringbuilder

Solutions on MaxInterview for stream reduce stringbuilder by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "stream reduce stringbuilder"
Mailys
24 Jun 2016
1List<Person> list = Arrays.asList(
2  new Person("John", "Smith"),
3  new Person("Anna", "Martinez"),
4  new Person("Paul", "Watson ")
5);
6
7String joinedFirstNames = list.stream()
8  .map(Person::getFirstName)
9  .collect(Collectors.joining(", ")); // "John, Anna, Paul"
10