diff options
| author | Rafi Zadanly <rafizadanly@gmail.com> | 2022-12-01 16:26:21 +0700 |
|---|---|---|
| committer | Rafi Zadanly <rafizadanly@gmail.com> | 2022-12-01 16:26:21 +0700 |
| commit | 0a0c497204acbac562700d80f38e74aa9ffcd94e (patch) | |
| tree | 3c2387091b0733d33754fbc07d843f2deef2fa9e /src/helpers/toTitleCase.js | |
| parent | 9e1321f7e35a58ba8ce136401a217d835aef15f0 (diff) | |
dynamic filter, dynamic pagination, detail brand, to title case
Diffstat (limited to 'src/helpers/toTitleCase.js')
| -rw-r--r-- | src/helpers/toTitleCase.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/helpers/toTitleCase.js b/src/helpers/toTitleCase.js new file mode 100644 index 00000000..5cfd70d0 --- /dev/null +++ b/src/helpers/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 |
