• Post Reply Bookmark Topic Watch Topic
  • New Topic

Strings to Integers  RSS feed

 
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
Boost this thread!