Java String codePoints() method

Java String codePoints() method


String codePoints() method added jdk 9.

This method Returns a stream of code point values from this sequence. Any surrogate pairs encountered in the sequence are combined as if by Character.toCodePoint and the result is passed to the stream. Any other code units, including ordinary BMP characters, unpaired surrogates, and undefined code units, are zero-extended to int values which are then passed to the stream.


Java Program Example:

class StringCodePoints{
public static void main(String args[]){
String str = "This is a String";
IntStream ins = str.codePoints().....// process with inStream api

}
}

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations