How do u get a string from the text field and convert it to an array of integers?
and how do u display a 2D array in a text area with the proper alignment and spaces?
getting an array of numbers from a text field
Started by strowa65, Dec 17 2007 08:43 PM
3 replies to this topic
#1
Posted 17 December 2007 - 08:43 PM
|
|
|
#2
Posted 18 December 2007 - 06:31 AM
I have another doubt...how do u reverse a string in java?
#3
Posted 18 December 2007 - 07:55 AM
You can use the string-function, reverse.
#4
Posted 18 December 2007 - 04:19 PM
Create a temporary string.
Break up your string by delimiter.
Each time you break a chunk off the begining, assign it as the value of the temporary string.
Use the Integer.parseInt() method to convert the string to an integer, and assign the returned value into your array.
Need some code, or was the above enough to explain?
Break up your string by delimiter.
Each time you break a chunk off the begining, assign it as the value of the temporary string.
Use the Integer.parseInt() method to convert the string to an integer, and assign the returned value into your array.
Need some code, or was the above enough to explain?
~Aristotle said:
It is the mark of an educated mind to entertain a tought without accepting it


Sign In
Create Account

Back to top









