Here is code with a stream:
List<String> fruits = Arrays.asList("apple", "orange", "banana");
long count = fruits.stream()
.map(word -> word.substring(0, 1))
.count();
The count is ...
Here is code with a stream:
List<String> fruits = Arrays.asList("apple", "orange", "banana");
long count = fruits.stream()
.map(word -> word.substring(0, 1))
.count();
The count is ...
Create a free account to access the full topic