2 Replies - 252 Views - Last Post: 15 March 2013 - 02:00 PM Rate Topic: -----

#1 Java.Programmer  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 16
  • Joined: 01-January 13

Parsing in Java

Posted 14 March 2013 - 05:44 PM

Hello all, I need help with parsing in Java. What I wanted to know was: 1) What is the actual process that is taken by the computer to parse a string. 2) How can you have a parsed integer in a string variable for example

String something = "2Nacl";
int i = Integer.parseint(something);


Thank you all!
Is This A Good Question/Topic? 0
  • +

Replies To: Parsing in Java

#2 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8329
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Parsing in Java

Posted 14 March 2013 - 07:29 PM

You can write a master thesis on a subject like this

http://dragonbook.st...own-Parsing.pdf

This post has been edited by pbl: 14 March 2013 - 07:30 PM

Was This Post Helpful? 0
  • +
  • -

#3 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2694
  • View blog
  • Posts: 11,360
  • Joined: 20-September 08

Re: Parsing in Java

Posted 15 March 2013 - 02:00 PM

Quote

How can you have a parsed integer in a string variable for example
You can't. An attempt to convert that into an int by the method you mentioned will fail. You'd have to remove non-digits
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1