diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-10-31 09:49:42 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-10-31 09:49:42 +0800 |
commit | 48653ec89538f1650106a5e77463412cad4684c2 (patch) | |
tree | 09687cd579462e04d539fd4615369fa6dae13902 /utils/stringUtils.js | |
download | SoopyV2-48653ec89538f1650106a5e77463412cad4684c2.tar.gz SoopyV2-48653ec89538f1650106a5e77463412cad4684c2.tar.bz2 SoopyV2-48653ec89538f1650106a5e77463412cad4684c2.zip |
first commit
Diffstat (limited to 'utils/stringUtils.js')
-rw-r--r-- | utils/stringUtils.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/utils/stringUtils.js b/utils/stringUtils.js new file mode 100644 index 0000000..920dd50 --- /dev/null +++ b/utils/stringUtils.js @@ -0,0 +1,11 @@ +module.exports = { + + firstLetterCapital: function (string) { + return string.substr(0, 1).toUpperCase() + string.substr(1) + }, + + firstLetterWordCapital: function (string) { + return string.split(" ").map(firstLetterCapital).join(" ") + } + +}
\ No newline at end of file |