Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

change to kebabcase in javascript

<script>
    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'));
</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: override submit button javascript 
Javascript :: search for country name from api with react 
Javascript :: generate global unique id javascript 
Javascript :: destructuring assignment js 
Javascript :: aws lambda create 
Javascript :: jQuery form upload 
Javascript :: only integer allowed javascript 
Javascript :: duplicate serial numbers asset 
Javascript :: get computer name in javascript in adobe livecycle designer 
Javascript :: aos cdn 
Javascript :: react proxy to flask server 
Javascript :: javascript find the smallest and biggest number in array 
Javascript :: how to stop re rendering in react hooks 
Javascript :: how to refrence schema in my mongoose schema with populate function 
Javascript :: using for loops to add an event listener 
Javascript :: loopover iterate elements by name js 
Javascript :: how to get second low value in js 
Javascript :: responsive varient in material ui 
Javascript :: js deconstruct rename 
Javascript :: bootstrap dropdown with state 
Javascript :: expression expected.ts switch case 
Javascript :: javascript border textbox 
Javascript :: cypress json no videos 
Javascript :: How to Compare Strings Using Mathematical Operators 
Javascript :: js set height of element 
Javascript :: _.extend can be used to attach functions to a prototype like this 
Javascript :: jqxAngular 
Javascript :: ticket 
Javascript :: pro side nav react rtl 
Javascript :: convert javascript to java 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =