From ee4297280c1305c7e03bedd4df63ccf136c28c6c Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 24 Jan 2023 15:54:48 +0700 Subject: Merapihkan struktur folder --- src/core/utils/toTitleCase.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/core/utils/toTitleCase.js (limited to 'src/core/utils/toTitleCase.js') 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 -- cgit v1.2.3