Thanks to all the guys that wrote something constructive on here
But it was my fault for not asking the question correctly. It was more like half of a question. Here's my dilemna:
I have a txt file filled with hundreds and thousands of digits and no spaces.
I can read from the text file no probs and have been using get chars to select the digits I need. But I can't figure out how to convert the newly formed character string into an integer. It won't accept Integer.parseInt ..well it compiles ok, but always throws up an error when it runs.
Am I doing something blatantly obvious or is their a trick to converting either a char array or a string from a text file into an integer?
I'm just using the following lines to test if it works.
String nmbrs = contents.toString();
System.out.println(nmbrs);
// char[] textArray = new char[3];
// nmbrs.getChars(9, 12, textArray, 0);
// System.out.println(textArray);
int difx;
difx=Integer.parseInt(nmbrs);
System.out.println(difx+1);
Can anyone see what I'm doing wrong?
Again, thanks for the help guys
