I was trying to solve a puzzle (see post in JavaRanch
https://coderanch.com/t/784868/java/puzzling-partitioningBy-IntStream-compile-error
)
I found that String.chars() yields an IntStream.
Someone pointed out that to convert it into Characters, one has to do

  Stream<Character> sc = s.chars().mapToObj(n -> (char) n);

It should not take so many obscure steps like this to turn a String into a
stream of chars!
I feel the Java API needs another method

Stream<Character> String.asChars()

thanks,
Anil

Reply via email to