mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Add a LowercaseString() utility function, courtesy of brg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14383 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f54ef97abc
commit
64aed54684
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user