Numerical value (int) ⇔ character string (String) conversion

Numerical value ⇒ Character string

String s = String.valueOf(i);

Character string ⇒ Numerical value

int i = Integer.parseInt(s);

Make a note because you use it often and forget it often.

Recommended Posts

Numerical value (int) ⇔ character string (String) conversion
Java type conversion (String, int, Date, Calendar, etc.)
URL to String conversion
Uri → String, String → Uri type conversion
Leet string conversion program
(Small story) Numerical value → simple conversion method of alphabet (Java)
Conversion of String, Date, LocalDate
[Java beginner] Conversion from character string to numerical value-What is the parseInt method of the Integer class? ~