<<< Parsing Numeric Strings | Index | Float.parseFloat >>> |
A String consisting of only integers or decimal numbers is called a numeric string
To convert a string consisting of an integer to a value of the type int, we use the following expression:
Integer.parseInt(strExpression)
For example,
Integer.parseInt("6723") = 6723 Integer.parseInt("-823") = -823
parseInt is a method of the class Integer, which converts a numeric integer string into a value of the type int
<<< Parsing Numeric Strings | Index | Float.parseFloat >>> |