fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. import java.util.stream.IntStream ;
  8.  
  9. /* Name of the class has to be "Main" only if the class is public. */
  10. class Ideone
  11. {
  12. public static void main (String[] args) throws java.lang.Exception
  13. {
  14. System.out.println(
  15. Integer.parseInt( Character.toString( "el5".codePoints().toArray()[ 2 ] ) )
  16. );
  17.  
  18. String element = "el5😷";
  19. IntStream stream = element.codePoints() ;
  20.  
  21. int[] codePoints = element.codePoints().toArray() ;
  22.  
  23. String out3 = "Third character: " + Character.toString( codePoints[2] ) + " | Code point: " + codePoints[2] + " | Named: " + Character.getName( codePoints[2] ) ;
  24. String out4 = "Fourth character: " + Character.toString( codePoints[3] ) + " | Code point: " + codePoints[3] + " | Named: " + Character.getName( codePoints[3] ) ;
  25.  
  26. System.out.println( out3 ) ;
  27. System.out.println( out4 ) ;
  28.  
  29. System.out.println(
  30. "el5".codePoints().toArray()[ 2 ]
  31. );
  32.  
  33. if( Character.isDigit( codePoints[2] ) )
  34. {
  35. String digit = Character.toString( codePoints[2] ) ;
  36. int i = Integer.parseInt( digit ) ; // Parse the character `5` as a `int` integer number.
  37. System.out.println( "i: " + i ) ;
  38. }
  39.  
  40. }
  41. }
Success #stdin #stdout 0.17s 57644KB
stdin
Standard input is empty
stdout
5
Third character: 5 | Code point: 53 | Named: DIGIT FIVE
Fourth character: 😷 | Code point: 128567 | Named: FACE WITH MEDICAL MASK
53
i: 5