Files
c-utils/str_util.cpp
2021-12-17 19:32:59 +08:00

16 lines
369 B
C++

#include "str_util.h"
#include "cstr_util.h"
#include <malloc.h>
bool str_util::tolowercase(std::string ori, std::string& result) {
char* tmp = nullptr;
auto re = cstr_tolowercase(ori.c_str(), ori.length(), &tmp);
if (re) {
result = std::string(tmp, ori.length());
free(tmp);
return true;
} else {
return false;
}
}