Without knowing the language, it's pretty imposible to write it. Once you start thinking recursively, it's not a difficult problem.
While you're recursing, pass the string without the first character.
The base case would be a null string which would return 0.
The unwind would just add one and return that.