This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
GoalFormat a text file using the following rules:
* Only a single space between words (remove excessive spaces);
* No spaces before punctuation marks;
* One space after each punctuation mark in front of a letter;
* Use only lowercase letters, except for the beginning of the sentence (after a dot);
* Remove repeated punctuation marks.
A punctuation mark is a character other than a space, a letter or a digit.
Input: "when a father gives to his son,,, Both laugh; When a son gives to his father, , , Both cry...shakespeare"
Output: "When a father gives to his son, both laugh; when a son gives to his father, both cry. Shakespeare"
A line of text.
A line containing the Formatted text.
The length of the input string is less than 1000.
One, two, three.
A higher resolution is required to access the IDE