Converting a string can be done with
std::transform(s.begin(), s.end(), s.begin(), ::toupper);
but what's the best way to transform it into a new modified copy ?
tried :
string s1="text",s2;
std::transform(s1.begin(), s1.end(), s2.begin(), ::toupper);
but it fails at runtime with "Segmentation fault"
I managed to do it by :
string s1="text",s2;
s2 = s1;
std::transform(s2.begin(), s2.end(), s2.begin(), ::toupper);
and of course you can create a function to go char by char, but I don't think that's optimal, and I'm not learning anything from this...