Hello. Can't pass 3rd requirement?? :) I have only one method --> main()
The code works fine :)
Please help me :D
package com.codegym.task.task08.task0823;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/*
Going national
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
String[] words = s.split(" ");
List<String> collect = Arrays.stream(words).filter(e -> !e.equals(""))
.map(e -> e.substring(0, 1).toUpperCase() + e.substring(1)).collect(Collectors.toList());
collect.forEach(e -> System.out.print(e + " "));
}
}