diff options
Diffstat (limited to 'src/utils/stringUtils.js')
-rw-r--r-- | src/utils/stringUtils.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/utils/stringUtils.js b/src/utils/stringUtils.js new file mode 100644 index 0000000..f28841c --- /dev/null +++ b/src/utils/stringUtils.js @@ -0,0 +1,15 @@ +module.exports = { + + firstLetterCapital: firstLetterCapital, + + firstLetterWordCapital: firstLetterWordCapital + +} + +function firstLetterCapital(string) { + return string.substr(0, 1).toUpperCase() + string.substr(1) +} + +function firstLetterWordCapital(string) { + return string.split(" ").map(firstLetterCapital).join(" ") +}
\ No newline at end of file |