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?
- What does Java option -Xmx stand for? [duplicate]
- What does Java option -Xmx stand for? [duplicate]
- Is there an invisible character that is not regarded as whitespace?
- Problem with gif with transparent background
- Finding white rectangle in an image
- 1000 * 60 * 60 * 24 * 30 results in a negative number [duplicate]
- How to convert nanoseconds to seconds using the TimeUnit enum?
- Search for words with telephone numbers from 2-3-4 tree
- Generate unique random numbers between 1 and 100
- How do you round UP a number?
- How do you round UP a number?
- Using or ‘|’ in regex [duplicate]
- How to format strings in Java
- What is the difference between x86 and x64
- && (AND) and || (OR) in IF statements
- How to use the toString method in Java?
- What is a NullPointerException, and how do I fix it?
- What exactly is Apache Camel?
- Unable to find valid certification path to requested target – error even after cert imported
- Unable to find valid certification path to requested target – error even after cert imported
- What is the equivalent of the C++ Pair
in Java? - Java – Convert integer to string [duplicate]
- Getting random numbers in Java [duplicate]
- What is an instance variable in Java?
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- Java: “error: cannot find symbol”
- What is the maximum value for an int32?
- How does the Java ‘for each’ loop work?
- What is a StackOverflowError?
- How to uninstall Eclipse?
- Why has the int32 type a maximum value of 2³¹ − 1? [duplicate]
- Is GNU’s Java Compiler (GCJ) dead? [closed]
- How to convert string to char array in C++?
- Easiest way to convert int to string in C++
- How does System.out.print() work?
- Converting integer to string in Python
- How do I “decompile” Java class files? [closed]
- How do I determine whether an array contains a particular value in Java?
- How to initialize an array in Java?
- How does the Java ‘for each’ loop work?
- Java 8 Iterable.forEach() vs foreach loop
- Initialize part of an array in java
- How to use symbols of extended ASCII table in C?
- How can I solve Exception in thread “main” java.lang.NullPointerException error [duplicate]
- Error: ‘int’ object is not subscriptable – Python
- How to split a string in Java
- What does “Could not find or load main class” mean?
- What does “Could not find or load main class” mean?
- Why am I getting a NoClassDefFoundError in Java?
- How to avoid “ConcurrentModificationException” while removing elements from `ArrayList` while iterating it? [duplicate]
- Eclipse/Maven error: “No compiler is provided in this environment”
- How do I compare strings in Java?
- What is reflection and why is it useful?
- Implementing UML diagram to Java [closed]
- How to round a number to n decimal places in Java
- Using Pairs or 2-tuples in Java [duplicate]