Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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
Source by www.textbotonline.com #
 
PREVIOUS NEXT
Tagged: #slugify #text #javascript
ADD COMMENT
Topic
Name
7+1 =