Don't use recursion - it's not a suitable method for processing this kind of request, and it may cause your app to fail.
This is an iterative problem, that just requires a simple loop: nothing in the "structure" of s string of characters is recursive, unlike the definition of factorial for example:
f(N) = N <= 1 ? 1 : N * f(N - 1)
Where the function is defined in terms of the function.
Use a simple for loop instead. Remember, each time you call a function, you use stack space, and that is very limited. A long string will exhaust the stack space in a recursive solution, where the looping version needs almost no stack at all. When you stack runs out, your app crashes.