4 Replies Latest reply on Feb 19, 2008 11:15 AM by 807603

    How to get ASCII value of string

      Hi there,
      I read a character from console through BufferedReader and now I want to get ASCII value of it.

      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      String str = br.readLine();

      I tried,
      int asciivalue =(int) str;

      but its giving error "Cannot cast from string to int"
      Please reply.