Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java string reduce

List < String > a = new ArrayList < > ();
a.add("John");
a.add("Alex");
a.add("Vincent");
String complete = a.stream().reduce("", (x, y) - > x + " " + y);
System.out.println(complete);
int total = IntStream.range(0, 20).reduce(0, (x, y) - > x + y);
System.out.println(total);
Source by dogukanhan.com #
 
PREVIOUS NEXT
Tagged: #java #string #reduce
ADD COMMENT
Topic
Name
2+1 =