28 lines
523 B
C
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
|