How could one convert a string to upper case. The examples I have found from googling only have to deal with chars.
ALL of these solutions on this page are harder than they need to be.
Do this
RegName = "SomE StRing That you wAnt ConvErTed";
NameLength = RegName.Size();
for (int forLoop = 0; forLoop < NameLength; ++forLoop)
{
RegName[forLoop] = tolower(RegName[forLoop]);
}
RegName
is your string
.
Get your string size don't use string.size()
as your actual tester, very messy and
can cause issues.
then. the most basic for
loop.
remember string size returns the delimiter too so use < and not <= in your loop test.
output will be: some string that you want converted