2025-09-18 15:21:43 +08:00
|
|
|
#include "Tool/Tool_String.h"
|
2025-09-15 11:28:54 +08:00
|
|
|
std::string Tool_toLowerCase(const std::string &str)
|
|
|
|
|
{
|
|
|
|
|
std::string result = str;
|
|
|
|
|
// 使用transform算法遍历字符串并转换为小写
|
|
|
|
|
std::transform(result.begin(), result.end(), result.begin(),
|
|
|
|
|
[](unsigned char c)
|
|
|
|
|
{ return std::tolower(c); });
|
|
|
|
|
return result;
|
|
|
|
|
}
|