This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am at a stage where I have a text file and a program that is reading it.
The text file contains a series of numbers seperated by a space. I want to read these numbers into my program and possibly store them into an array. Having limited knowledge and not seeimg to be able to find any documentation on the web i can use, using tokens SEEMS to be in the step in the right direction.
I know these are used from strings and trying to retrieve words etc, and my thinking was obtain each number from the text file as a string and then convert them into integers in my program. Is it possible to do?
If not, what other way is there to extract these numbers from the text file and store them as integers?
Thanks [ October 28, 2005: Message edited by: Sam Bluesman ]
If you have all the numbers in a string, and you know that all are separated by a space, you can use the split(� �) function. Applied over the String it will return a String array with each String representing a number. Then you can create an Integer with each String if you need it
She will remember your heart when men are fairy tales in books written by rabbits.<br /> As long as there is duct tape... there is also hope.