Convert String to int using recursion

How do I approach the convert string to int problem? I tried a method and it worked but it’s not entirely recursive

Refer this https://www.geeksforgeeks.org/convert-a-string-to-an-integer-using-recursion/

Is this method better or just iterating over the string and printing s[i]-‘0’?

In this case iteration would be better. Because recursion takes extra memory space.