Java code snippet to count number of spaces in a string

Comments