SHARE
TWEET

codePointAt

DulcetAirman Jul 19th, 2018 (edited) 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class SomeClass {
  4.  
  5.   public static void main(String[] args) {
  6.     try (Scanner scanner = new Scanner(System.in)) {
  7.       System.out.println("enter a character and hit <enter> to know its Unicode code point");
  8.       String str = scanner.nextLine();
  9.       int i = str.codePointAt(0);
  10.       System.out.print(str);
  11.       System.out.print(": ");
  12.       System.out.println(i);
  13.     }
  14.   }
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top