Add a LowercaseString() utility function, courtesy of brg.

llvm-svn: 14383
This commit is contained in:
Misha Brukman 2004-06-24 23:38:52 +00:00
parent 57b3f07b31
commit a2b7b5b128

View File

@ -97,6 +97,13 @@ static inline std::string ftostr(double V) {
return Buffer;
}
std::string LowercaseString (const std::string &S) {
std::string result (S);
for (unsigned i = 0; i < S.length(); ++i)
if (isupper (result[i]))
result[i] = tolower(result[i]);
return result;
}
/// getToken - This function extracts one token from source, ignoring any
/// leading characters that appear in the Delimiters string, and ending the