2024-04-25 22:34:51 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifndef PP_DEBUG
|
|
|
|
#include <algorithm>
|
|
|
|
#include <string>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
inline void toLower(std::string &str) {
|
|
|
|
std::transform(str.begin(), str.end(), str.begin(),
|
|
|
|
[](unsigned char c){ return std::tolower(c); });
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void toUpper(std::string &str) {
|
|
|
|
std::transform(str.begin(), str.end(), str.begin(),
|
|
|
|
[](unsigned char c){ return std::toupper(c); });
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool isInt(const std::string &str) {
|
|
|
|
return str.find_first_not_of("1234567890") == std::string::npos;
|
|
|
|
}
|
2024-04-26 19:05:35 +02:00
|
|
|
|
|
|
|
inline bool isBlank(const std::string &str) {
|
|
|
|
return str.find_first_not_of(" \n\t\v\r\f") == std::string::npos;
|
|
|
|
}
|