DEV Community

Discussion on: I have a problem, counting words didn't start from 1?

 
ripaz profile image
Ripaz

You are checking if space exists before word. Since first word doesn't have space before it, it fails to count it.