mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-06 08:00:18 +07:00
GitOrigin-RevId: c4db6507c258e5611f6d47b9373a0c2531802345
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);
|
|
}
|
|
} |