freeCodeCamp/common/utils/index.js

8 lines
158 B
JavaScript
Raw Normal View History

2016-06-01 22:52:08 +00:00
export function dashify(str) {
return ('' + str)
.toLowerCase()
.replace(/\s/g, '-')
.replace(/[^a-z0-9\-\.]/gi, '')
.replace(/\:/g, '');
2016-01-04 22:26:07 +00:00
}