Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

kebab case javascript

const kebabCase = string => string
        .replace(/([a-z])([A-Z])/g, "$1-$2")
        .replace(/[s_]+/g, '-')
        .toLowerCase();
  
    console.log(kebabCase('Geeks For Geeks'));
    console.log(kebabCase('GeeksForGeeks'));
    console.log(kebabCase('Geeks_For_Geeks'));
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #kebab #case #javascript
ADD COMMENT
Topic
Name
9+6 =