Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java find longest string in list

// Find longest String in a List
public void changeList(List<String> list) {
    String longestString = list.stream().max(Comparator.comparingInt(String::length)).get();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #find #longest #string #list
ADD COMMENT
Topic
Name
7+1 =