diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-11-11 15:26:55 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-11-11 15:26:55 +0700 |
| commit | c1ef10e3655904f4fe5b085460a89dc5c5a774cb (patch) | |
| tree | 11b17b71714966c54e0ae7efb06136d77e6e05a7 /src/utils | |
| parent | 2e1c0fb77932bdd0681f8d7c9cfd292a9ac52b3b (diff) | |
| parent | bf668785232e2d7abba1660dfdb6eb2746adc09a (diff) | |
Merge branch 'new-release' into CR/new_product_detail
# Conflicts:
# src/lib/product/components/Product/ProductDesktopVariant.jsx
Diffstat (limited to 'src/utils')
| -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 |
