I have a string name2
. I want to remove the capital characters in it and put lowercase instead.
Input:Car
Output:car
Here is my loop code:-
if(isupper(name2.at(i))) {
string tem=to_string(tolower(name2.at(i)));
name2.erase(i,1);
name2.insert(i,tem);
}
i
is just the loop variable.
However , here is my input vs output
Input:Sushant
Output:115ushant
It is giving some sort of ASCII equivalent ouput , I suppose. How do I fix this?