Final answer:
To count the length of a string without punctuation and spaces, remove those elements and then count the remaining characters. The example sentence without punctuation and spaces has 21 characters.
Step-by-step explanation:
To count the length of a string without commas, periods, and white spaces, like in the example "Hello, Mr. John. Have a good day.", you would remove the characters you don't want to count and then count the remaining characters. This process can also help you to review your understanding of letters and sounds in English spelling. We need to first count the letters in each word after having removed the punctuation and spaces. For example, after removing the commas, periods, and spaces from the given sentence, we are left with "HelloMrJohnHaveagoodday" which has a total of 21 letters.