Outline how a Java program could convert a string such as “1,2,3,4,5” into an array ({1, 2, 3, 4,5})
Take the 2-minute tour
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
|
From zvzdhk:
Then, parse your integers:
|
|||||||||
|
Use StringTokenizer which will split string by comma and then put those values/tokens in array of integers.
|
|||||
|
Try this:
|
|||||||||||||
|
|
|||
|