Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

slugify text javascript

const slugify = (string) => {
  const newText = string
    .toLowerCase()
    .replace(/ /g, "-")
    .replace(/[^w-]+/g, "");
  
  return newText
};

console.log(slugify("Hello world"))
//hello-world
Comment

PREVIOUS NEXT
Code Example
Javascript :: vertical align center react native view 
Javascript :: joi phone number validation 
Javascript :: decimal parse thousand separator javascript 
Javascript :: js object to querystring 
Javascript :: discord.js all intents 
Javascript :: jquery close bootstrap model 
Javascript :: js format number thousands separator 
Javascript :: javascript prevent context menu 
Javascript :: javascript count words in string 
Javascript :: onclick javascript confirm 
Javascript :: E: Unable to locate package nodejs 
Javascript :: javascript float element right 
Javascript :: how to fetch the selected value of dropdown jquery 
Javascript :: js is object empty 
Javascript :: Select at random from array 
Javascript :: get every member of a server discord js 
Javascript :: discordjs 13 TypeError Valid intents must be provided for the Client. 
Javascript :: how to adjust the caledar height fullcalendar 
Javascript :: how to limit decimal places in javascript 
Javascript :: base64 encode node js 
Javascript :: chartjs how to disable animation 
Javascript :: javascript find file extension from string 
Javascript :: javascript time execution 
Javascript :: generate random number jquery 
Javascript :: javascript document load 
Javascript :: Hide a div on clicking outside it with jquery 
Javascript :: ajax header jquery 
Javascript :: stop immediate propagation 
Javascript :: console.log object to json 
Javascript :: if media query jquery 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =