How can I get the string with more lowercase characters from a given List?

Im just wondering how can I get the string with more lowercase characters from a given List.

I´m already did it in a functional way, using Java 10 Streams, but I want to do it in an iterative way, using WHILE blokcs. But I have no idea how to do it. Im a begginer, so please if you see something annoying tell me.

This is my functional code. Thank you so much.

public static Optional stringSearched (List pl) {

return pl.stream().max(Comparator.comparing(x->x.chars().filter(Character::iLowerCase).count()));

{...

Read More »

By: StackOverFlow - 5 days ago

Related Posts