Write a method called collapseSpaces that accepts a Scanner representing an input file as its parameter, then
Question:
Write a method called collapseSpaces that accepts a Scanner representing an input file as its parameter, then reads that file and outputs it with all its tokens separated by single spaces, collapsing any sequences of multiple spaces into single spaces. For example, consider the following text:
many spaces on this line!
If this text were a line in the file, the same line should be output as follows:
many spaces on this line!
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Question Posted: