I honestly don't even know where to start with this. I know I'm supposed to incorporate loops in this, but I'm unsure how to approach this. I would appreciate it if someone could walk me through the logic behind this without giving me the answer as I want to be able to solve this myself.
My thought process is:
- Count the length of the string. (totalLength)
- Count the length of the string without the specified character (notCharLength)
- totalLength - notCharLength = answer
- Then use if else statements to print the output
The problem I'm running into is that I don't know how to distinguish specific characters from inside the string.