forked from OSchip/llvm-project
Add an uppercase conversion utility function.
llvm-svn: 43146
This commit is contained in:
parent
79dfbed6f6
commit
64035f3b8e
|
@ -109,6 +109,14 @@ static inline std::string LowercaseString(const std::string &S) {
|
|||
return result;
|
||||
}
|
||||
|
||||
static inline std::string UppercaseString(const std::string &S) {
|
||||
std::string result(S);
|
||||
for (unsigned i = 0; i < S.length(); ++i)
|
||||
if (islower(result[i]))
|
||||
result[i] = char(toupper(result[i]));
|
||||
return result;
|
||||
}
|
||||
|
||||
/// StringsEqualNoCase - Return true if the two strings are equal, ignoring
|
||||
/// case.
|
||||
static inline bool StringsEqualNoCase(const std::string &LHS,
|
||||
|
|
Loading…
Reference in New Issue