I want to convert a std::string
to lowercase. I am aware of the function tolower()
, however in the past I have had issues with this function and it
I tried std::transform, all i get is abominable stl criptic compilation error that only druids from 200 years ago can understand (cannot convert from to flibidi flabidi flu)
this works fine and can be easily tweaked
string LowerCase(string s)
{
int dif='a'-'A';
for(int i=0;i='A')&&(s[i]<='Z'))
s[i]+=dif;
}
return s;
}
string UpperCase(string s)
{
int dif='a'-'A';
for(int i=0;i='a')&&(s[i]<='z'))
s[i]-=dif;
}
return s;
}