This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cast a String to a long?

 
Michael Brewer
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to cast a String to a long? I first looked for String methods that would allow me to do this, and then I tried doing this:

That gives me an 'inconvertible types' error.
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael
Check out the parseLong() method in the Long class. It takes a String arguemnt and returns a long (primitive).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!