mirror of
https://github.com/esphome/esphome.git
synced 2025-02-07 13:40:59 +00:00
copy
This commit is contained in:
parent
54f28f7719
commit
70a89efb36
@ -278,9 +278,9 @@ std::string str_snake_case(const std::string &str) {
|
||||
return result;
|
||||
}
|
||||
std::string str_sanitize(const std::string &str) {
|
||||
std::string out;
|
||||
std::string out = str;
|
||||
std::replace_if(
|
||||
str.begin(), str.end(),
|
||||
out.begin(), out.end(),
|
||||
[](const char &c) {
|
||||
return !(c == '-' || c == '_' || (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user