Hi, I am new to java, i got some set of text in a file. i need to read those text and display in such a way that each line should contain only 20 characters. i.e., After reading all those text when wirting in a browser it should display only 20 characters in a line. how this can be done in tokenizer or any other option is there. Pls give me some sample coding, thank you
On your way in you may have missed that JavaRanch has a policy on display names, and yours does not comply with it - please adjust it accordingly, which you can do right here. Thanks for your prompt attention to this matter.
As to your question, I don't think you need a tokenizer. Check out the "substring" methods of the String class. They allow you extract specific portions of a string (e.g. the 21st to 40th character). Just make sure that the "end" index is not beyond the length of your line.
Fire me boy! Cool, soothing, shameless self promotion: