Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to convert string to kebab case in javascript

const kebabCase = (string) => {
  const kebabCase = string => string
      .replace(/([a-z])([A-Z])/g, "$1-$2")
      .replace(/[s_]+/g, '-')
      .toLowerCase();

  const newText = kebabCase(string);
  return newText
};
Comment

PREVIOUS NEXT
Code Example
Javascript :: function to generate random color in javascript 
Javascript :: get height element use js 
Javascript :: vue 3 cdn 
Javascript :: Unable to resolve module react-navigation 
Javascript :: jquery set href of link 
Javascript :: remove previous datatable instance 
Javascript :: js scroll to bottom 
Javascript :: pass url params to child router express 
Javascript :: react native flatlist get visible items 
Javascript :: object to url params js 
Javascript :: link next js target _blank 
Javascript :: how to run vue js project on different port 
Javascript :: jquery validation errorplacement 
Javascript :: upgrading node on mac 
Javascript :: content type json 
Javascript :: jquery remove element by id 
Javascript :: how to change background image using javascript 
Javascript :: sanity install 
Javascript :: fs check if dir is dir 
Javascript :: uuid v4 react 
Javascript :: express send 200 
Javascript :: node js procfile heroku starter 
Javascript :: jquery min 
Javascript :: add bootstrap to react,.........,,,, 
Javascript :: delete first character javascript 
Javascript :: Error: Material-UI: The data grid component requires all rows to have a unique id property. 
Javascript :: internal/modules/cjs/loader.js:905 throw err; 
Javascript :: js object length 
Javascript :: header ejs 
Javascript :: check email regex js 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =