Hi. i'm new to Java.
Pls i need assistance on how to reduce spaces (which are more than one) between words in a text file .
Thanks.
Hi. i'm new to Java.
Pls i need assistance on how to reduce spaces (which are more than one) between words in a text file .
Thanks.
Hello tyolu and welcome to the Java Programming Forums :D
You will need to read in the text file line by line and then re-write it out again.
There is a tutorial for reading a file line by line here:
http://www.javaprogrammingforums.com...ner-class.html
Is the white space between words constant or does it change?
You can use Regular Expressions and String replace.
Let me know and I will help you with the code.
This post may also be of some help to you:
http://www.javaprogrammingforums.com...text-file.html