Brewhouse/lib/Tools/Tools.h
2023-01-25 21:00:25 -05:00

28 lines
523 B
C

#ifndef TOOLS_h
#define TOOLS_h
/** Convert String to slug by making lowercase and
* and replacing spaces with `_`.
*/
String slugify(String input) {
input.toLowerCase();
input.replace(" ", "_");
return input;
}
/** Convert char array to slug by making lowercase and
* and replacing spaces with `_`.
char* slugify(char* input) {
char* output;
strcpy(output, input);
strlwr(output);
for (uint8_t i=0; i<strlen(output); i++)
if (output[i] == ' ') output[i] = '_';
return output;
}
*/
#endif