Recursion convert string to integer

i am not able to form the code for this problem.
pls tell the correct code.

@yutikakhanna
I have given you pseudocode for the the question, now try to come up with a solution.
F(id, string,ans_till_now) :
if(id==string.size()) you have to return ans_till_now;
else F(id+1,string,ans_till_now * 10 + s[id]-‘0’)

can you tell in the form of a code