Question: Given a line of text as input, output the number of characters excluding spaces, periods, or commas. Ex: If the input is: Listen, Mr.
Given a line of text as input, output the number of characters excluding spaces, periods, or commas. Ex: If the input is: Listen, Mr. Jones, calm down. the output is: 21 Note: Account for all characters that aren't spaces, periods, or commas (Ex: "r", "2", "!").
Step by Step Solution
3.45 Rating (158 Votes )
There are 3 Steps involved in it
You can achieve this in Java using the replaceAll method to remove spaces periods and ... View full answer
Get step-by-step solutions from verified subject matter experts
