Character.getNumericValue(c)
The java.lang.Character.getNumericValue(char ch)
returns the int
value that the specified Unicode character represents. For example, the character '\u216C'
(the roman numeral fifty) will return an int with a value of 50.
The letters A-Z in their uppercase ('\u0041' through '\u005A')
, lowercase ('\u0061' through '\u007A')
, and full width variant ('\uFF21' through '\uFF3A' and '\uFF41' through '\uFF5A')
forms have numeric values from 10 through 35. This is independent of the Unicode specification, which does not assign numeric values to these char values.
This method returns the numeric value of the character, as a nonnegative int value;
-2 if the character has a numeric value that is not a nonnegative integer;
-1 if the character has no numeric value.
Related Posts:
- How do I convert a String to an int in Java?
- How to convert a char to a String?
- Convert String to double in Java
- A JNI error has occurred, please check your installation and try again in Eclipse x86 Windows 8.1
- How can I convert a char to int in Java? [duplicate]
- How do I parse a string to a float or int?
- Converting String to “Character” array in Java
- Create ArrayList from array
- How do I generate random integers within a specific range in Java?
- How do I generate random integers within a specific range in Java?
- How can I convert a character to a integer in Python, and viceversa?
- How can I properly compare two Integers in Java?
- How can I convert a character to a integer in Python, and viceversa?
- typeof in Java 8
- Convert an integer to an array of characters : java
- How to convert integer to string in C?
- How to check whether a int is not null or empty?
- Declaring an unsigned int in Java
- Converting Hexadecimal String to Decimal Integer
- What is the easiest/best/most correct way to iterate through the characters of a string in Java?
- Exception in thread “main” java.lang.NumberFormatException: For input string: “S”
- int cannot be converted to string?
- How can I convert integer into float in Java?
- How to implement infinity in Java?
- Converting String Array to an Integer Array
- How to check if the value is integer in java?
- Converting a string to an integer on Android
- How can I check if a single character appears in a string?
- Convert an integer to an array of digits
- Replace a character at a specific index in a string?
- How can I check if a value is of type Integer?
- “Integer number too large” error message for 600851475143
- Convert double to Int, rounded down
- Converting from byte to int in Java
- Java equivalent of unsigned long long?
- Cannot invoke toString() on the primitive type int
- How to compare character ignoring case in primitive types
- Why int[] a = new int[1] instead of just int a?
- Why int[] a = new int[1] instead of just int a?
- C++ floating point to integer type conversions
- Why cannot cast Integer to String in java?
- Conversion from Long to Double in Java
- How to convert integers to characters in C?
- Round a floating-point number down to the nearest integer?
- Cannot make a static reference to the non-static method fxn(int) from the type Two
- How to implement a tree data-structure in Java?
- Difference between StringBuilder and StringBuffer
- “Missing return statement” within if / for / while
- A JNI error has occurred, please check your installation and try again in Eclipse x86 Windows 8.1
- Round a double to 2 decimal places
- com.atomikos.icatch.SysException: Error in init: Log already in use? tmlog in ./
- @ converted to %40 in HTTPPost request
- Global variables in Java
- Java implementation for Min-Max Heap?
- How can I convert a long to int in Java?
- What’s the purpose of META-INF?
- JVM Crash – “EXCEPTION_ACCESS_VIOLATION”
- How to connect to FTP over TLS/SSL (FTPS) server in Java
- How to check type of variable in Java?
- Spring boot – Request method ‘POST’ not supported. Tried everything
- How can I remove a character from a string using JavaScript?
- Convert .class to .java
- What does Scanner input = new Scanner(System.in) actually mean?
- Integer range when using 64bit jdk
- Removing whitespace from strings in Java
- what is this ANT build?
- org.glassfish.jersey.servlet.ServletContainer ClassNotFoundException
- How to get the current working directory in Java?
- What is a safe way to create a Temp file in Java?
- Missing method body, or declare abstract in Java
- java code is showing error. ( ‘;’,expected)
- Efficient swapping of elements of an array in Java
- local variables referenced from an inner class must be final or effectively final
- java.lang.NumberFormatException: empty String
- Java and Windows – error: illegal escape character
- How should I copy Strings in Java?
- Bank Account Java Program
- List of all special characters that need to be escaped in a regex
- No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
- java.lang.ArithmeticException: / by zero
- ReferenceError: “alert” is not defined
- How to write an ArrayList of Strings into a text file?
- how to fix Cannot call sendRedirect() after the response has been committed?
- Correct way to add external jars (lib/*.jar) to an IntelliJ IDEA project
- difference between equals() and hashCode()
- Adding days to a date in Java
- Jackson with JSON: Unrecognized field, not marked as ignorable
- Convert floats to ints in Pandas?
- Create a two dimensional string array anArray[2][2]
- A beginner’s error (args[0]) [duplicate]
- How to convert string to float?
- When/why to call System.out.flush() in Java
- Throwing multiple exceptions in Java
- fixing errors on a program to call methods in java
- Can you write virtual functions / methods in Java?
- Creating video player using Java
- Can I override and overload static methods in Java?
- How can i fix this equals on primitive type(int)
- Split string into array of character strings
- intellij idea – Error: java: invalid source release 1.9