Advertisement
deddyprianto

convertString

Mar 1st, 2024
690
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   const convertString = (inputString) => {
  2.     const words = inputString.split("_");
  3.     const capitalizedWords = words.map(
  4.       (word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(),
  5.     );
  6.     const result = capitalizedWords.join(" ");
  7.     return result;
  8.   };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement