• Post Reply Bookmark Topic Watch Topic
  • New Topic

Converting a String to an int

 
Elon Zibitt
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm having trouble converting a String to an int. i've seen methods to convert from String to Integer but nothing from String to int or Integer to int.
Please Help!
thanks in advance,
elon
 
Maky Chopra
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not related to jsp/servlets but ...
use the method Integer.parseInt(). Example:

String s = "123";
int i = Integer.parseInt( s );
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!