I have previously found this code in doing a recursion on string reversing but I couldn't understand how the code work, could I possibly get some explanation? thank you!
std::string reverse(std::string str) {
if(str.length()==0)
return "";
return reverse(str.substr(1)) + str[0];
}