This week's book giveaway is in the Cloud forum.
We're giving away four copies of The Business Blockchain and have William Mougayar on-line!
See this thread for details.
Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strings to Integers

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new to Java.
I have a simple textField that users can put information in. What I need to do is convert their input in the form of
input$="(1,2,4,5,9)"
to an int[]=[1,2,4,5,9]
That is I need to take a string which is entered with parentheses and commas and divide it up into its the substrings and make sure that the user has put valid integers in there. Is there built in capability to do this?
Thanks
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Nope, to my knowledge there is no built-in capability
to do this. You should write your own class to do it.
Should be pretty straight forward, with a little effort
since you say you are new.
pseudocode....

Also, I think this post will fit into the JIG (Beginner)
forum rather than in the Applet forum.
- satya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic