fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. String input = "Dog  Cat" ;
  13. int[] codePoints = input.codePoints().toArray() ;
  14. for( int codePoint : codePoints )
  15. {
  16. System.out.println( "Code point " + codePoint + " is: " + Character.getName( codePoint ) ) ;
  17. }
  18.  
  19. System.out.println(
  20. Arrays.equals(
  21. "Dog  Cat".codePoints().toArray() ,
  22. "Dog Cat".codePoints().toArray()
  23. )
  24. );
  25. }
  26. }
Success #stdin #stdout 0.22s 55252KB
stdin
Standard input is empty
stdout
Code point 68 is: LATIN CAPITAL LETTER D
Code point 111 is: LATIN SMALL LETTER O
Code point 103 is: LATIN SMALL LETTER G
Code point 32 is: SPACE
Code point 160 is: NO-BREAK SPACE
Code point 67 is: LATIN CAPITAL LETTER C
Code point 97 is: LATIN SMALL LETTER A
Code point 116 is: LATIN SMALL LETTER T
false