Files
geant4/source/analysis/g4tools/include/tools/touplow
T
2016-12-09 12:35:28 +01:00

28 lines
606 B
Plaintext

// Copyright (C) 2010, Guy Barrand. All rights reserved.
// See the file tools.license for terms.
#ifndef tools_touplow
#define tools_touplow
#include <string>
namespace tools {
inline void tolowercase(std::string& a_string){
for(std::string::iterator it=a_string.begin();it!=a_string.end();++it) {
char c = *it;
*it = ((c) >= 'A' && (c) <= 'Z' ? c - 'A' + 'a' : c);
}
}
inline void touppercase(std::string& a_string){
for(std::string::iterator it=a_string.begin();it!=a_string.end();++it) {
char c = *it;
*it = ((c) >= 'a' && (c) <= 'z' ? c - 'a' + 'A' : c);
}
}
}
#endif