This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
this code cuts the lines in file into equal length peaces. Parsing works fine if i do everything in main without making method (Cut) to the parsing part. But I to want to make method (Cut) that does the parsing. It's not working right. If first word is "this" it should parse the file into lines that have 4 chars. It works fine until there is under 4 chars left for the last line. So it shows only even lines. Why is that? FILE this is not working
Originally posted by kristian jarvi: [QB]this code cuts the lines in file into equal length peaces. <snip> it should print this is n ot w orki ng
So wait, the space that's already there between "this" and "is" should be taken out but the end-of-line markers should be converted to spaces? Maybe I'm completely missing the point of what this code is supposed to be doing, but I took a shot at simplifying it anyhow: