Initial Commit.
Nothing works here.
This commit is contained in:
27
lib/Tools/Tools.h
Normal file
27
lib/Tools/Tools.h
Normal file
@ -0,0 +1,27 @@
|
||||
#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
|
Reference in New Issue
Block a user