23 lines
467 B
C++
23 lines
467 B
C++
#include "StringUtils.h"
|
|
#include <locale>
|
|
#include <algorithm>
|
|
|
|
bool StringUtils::IsAlphaNumeric(char c)
|
|
{
|
|
std::locale loc;
|
|
return std::isalnum(c, loc);
|
|
}
|
|
|
|
bool StringUtils::IsSpace(char c)
|
|
{
|
|
std::locale loc;
|
|
return std::isspace(c, loc);
|
|
}
|
|
|
|
std::string StringUtils::ToLower(const std::string& s)
|
|
{
|
|
std::string ret;
|
|
std::transform(s.begin(), s.end(), ret.begin(),
|
|
[](unsigned char c){ return std::tolower(c); });
|
|
return ret;
|
|
}
|