Java String chars():
chars method is introduced in package java.lang.String class from Java 9 onwards. This method returns a stream of int zero-extending the char values from this sequence. Any char which maps to a surrogate code point is passed through uninterpreted. If the sequence is mutated while the stream is being read, the result is undefined.
Syntax:
public IntStream chars()
This method returns IntStream which holds of characters of input string and will have some light performance penalty.