Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

String equivalent of Integer.parseInt()

807591May 10 2008 — edited May 11 2008
Hey..

Integer.parseInt() reads an integer that is being inputted right? what im looking though is some sort of a String equivalent of Integer.parseInt.

ex:
nString = JOptionPane.showInputDialog("Enter number:");
n = Integer.parseInt(nString);

what im looking:
nString = JOptionPane.showInputDialog("Enter text:");
n = ? (nString);

a keyword that reads the text inputted.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 8 2008
Added on May 10 2008
12 comments
656 views