Hoping Julian add’s to the String class…
(Useful for CamelCase)
const String String::toTitleCase () const throw()
{
String result (*this);
result.dupeInternalIfMultiplyReferenced();
tchar* t = result.text->text;
bool wordStart=true;
while (*t != 0)
{
if (CharacterFunctions::isWhitespace(*t) || !CharacterFunctions::isLetterOrDigit(*t))
{
wordStart = true;
}
else if (wordStart == true)
{
CharacterFunctions::toUpperCase(t);
wordStart = false;
}
else
{
CharacterFunctions::toLowerCase(t);
}
++t;
}
return result;
}