This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

converting an array of string to double value.....

 
Philip Zac
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

Is there any way that I can convert a string say ("11, 22, 33") to an array of double values ???

Thanks

Philip
 
Sid Murrey
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use StringTokenizer with a matching delimiter pattern to split the string according to the commas. Then iterate over the resulting array and use the Double.valueOf() method to convert the Strings to doubles.
[ July 10, 2008: Message edited by: Cedric Meury ]
 
Philip Zac
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks alot Cedric Meury ......


Philip
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic