mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-31 02:50:55 +07:00
11 lines
306 B
Java
11 lines
306 B
Java
// "Collapse loop with stream 'sum()'" "true-preview"
|
|
|
|
import java.io.BufferedReader;
|
|
import java.io.IOException;
|
|
|
|
public class Main {
|
|
void test(BufferedReader br) throws IOException {
|
|
long count = br.lines().map(String::trim).mapToLong(String::length).sum();
|
|
System.out.println(count);
|
|
}
|
|
} |