diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-11-13 16:11:09 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-11-13 16:11:09 +0700 |
| commit | c873a401f0ea13e1881278e7977d4013d3a87394 (patch) | |
| tree | 5474f90a5e2530f3d3fae38a0a9876fd20bd2c00 /src/utils/capializeFIrstWord.js | |
| parent | b9e64c111f21ac32466fa2a0f095df83ff111252 (diff) | |
| parent | 66e990de0a552cbc63e2db0e9e93c84520a806f2 (diff) | |
Merge branch 'new-release' into Feature/pengajuan-tempo
Diffstat (limited to 'src/utils/capializeFIrstWord.js')
| -rw-r--r-- | src/utils/capializeFIrstWord.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils/capializeFIrstWord.js b/src/utils/capializeFIrstWord.js new file mode 100644 index 00000000..b62d0c06 --- /dev/null +++ b/src/utils/capializeFIrstWord.js @@ -0,0 +1,9 @@ +export const capitalizeEachWord = (str) => { + return str + .split(' ') // Pisahkan string menjadi array kata-kata + .map((word) => // Ubah huruf pertama setiap kata menjadi besar + word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() + ) + .join(' '); // Gabungkan kembali menjadi string + }; +
\ No newline at end of file |
