2020-04-13

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

}
}

1 comment:

  1. Java String codePoints() method

    Very informative post about Java String codepoint method...!

    Will try this method...

    Check out our Front End Development Services

    best Front End Development Services Company


    ReplyDelete