Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to convert string to toggle case in javascript

const toggleCase = (string) => {
  const newText = string
    .toUpperCase()
    .split(" ")
    .map(function(word) {
      return word.charAt(0).toLowerCase() + word.slice(1);
    })
    .join(" ");
  
  return newText;
};
Source by www.textbotonline.com #
 
PREVIOUS NEXT
Tagged: #convert #string #toggle #case #javascript
ADD COMMENT
Topic
Name
6+1 =