Files
LABS_EDUCATION/lr11/task_1/e3.java
2026-04-07 21:06:51 +05:00

22 lines
705 B
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package lr11.task_1;
import java.util.List;
import java.util.stream.Collectors;
public class e3 {
public static List<String> getCapitalizedStrings(List<String> strings) {
return strings.stream()
.filter(s -> Character.isUpperCase(s.charAt(0)))
.collect(Collectors.toList());
}
public static void main(String[] args) {
List<String> stringList = List.of("aaaAASd", "ASDASdsdasd", "qwedGSD", "SDFSD", "oiy", "SADjk", "Pyg");
List<String> result = getCapitalizedStrings(stringList);
System.out.println("Строки, начинающиеся с большой буквы:");
result.forEach(System.out::println);
}
}