Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you convert a Integer to an String?

Status
Not open for further replies.

Kruzer

Programmer
Jun 16, 2000
117
US
I know how to convert a String to a integer, can't remember how to do the other. Do I use the charAt()?

newValue = Integer.parseInt(value);

String newStringValue = ????
Dano
dskryzer@hotmail.com
What's your major malfunction
 
Very easy actually:
Code:
newValue = Integer.parseInt(value);
String newStringValue = newValue.toString();
Wushutwist
 
Hey, which are you looking for? Integer to String or String to Integer (your topic and explaination in your first post is different...

Anyway I will list out the following ways...

String to Integer:
Integer a = new Integer(value);

Integer to String:
String a = value.toString();

String to int:
int a = Integer.parseInt(value);

int to String:
String a = ""+value;

Leon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top