summaryrefslogtreecommitdiff
path: root/src/core/utils/toTitleCase.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/utils/toTitleCase.js')
-rw-r--r--src/core/utils/toTitleCase.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/utils/toTitleCase.js b/src/core/utils/toTitleCase.js
new file mode 100644
index 00000000..5cfd70d0
--- /dev/null
+++ b/src/core/utils/toTitleCase.js
@@ -0,0 +1,8 @@
+export default function toTitleCase(str) {
+ return str.replace(
+ /\w\S*/g,
+ function(txt) {
+ return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
+ }
+ );
+} \ No newline at end of file