Popular Posts

Thursday, May 21, 2015

How to convert a String to int in Java?

We face issue converting integer/float/double/character - to / from String. Below is a sample code to do it

int i = Integer.parseInt("33");

code to convert char to string - there are many ways to do it ..

String str = String.valueOf('c');

String str1 = Character.toString('c');

String str2 = new Character('c').toString();


No comments: