Rewritten some code without using iterators.

This commit is contained in:
Vincent Richard 2005-12-30 20:29:36 +00:00
parent 4a812f13bf
commit 500f065c94

View File

@ -77,25 +77,25 @@ const bool stringUtils::isStringEqualNoCase
const string stringUtils::toLower(const string& str)
{
string out(str);
const string::iterator end = out.end();
string out;
out.resize(str.size());
for (string::iterator i = out.begin() ; i != end ; ++i)
*i = std::tolower(*i, std::locale());
for (string::size_type i = 0, len = str.length() ; i < len ; ++i)
out[i] = std::tolower(str[i], std::locale());
return (out);
return out;
}
const string stringUtils::toUpper(const string& str)
{
string out(str);
const string::iterator end = out.end();
string out;
out.resize(str.size());
for (string::iterator i = out.begin() ; i != end ; ++i)
*i = std::toupper(*i, std::locale());
for (string::size_type i = 0, len = str.length() ; i < len ; ++i)
out[i] = std::toupper(str[i], std::locale());
return (out);
return out;
}