Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/esm/string/index.js>hyphenate

A JavaScript extension package for building strong and modern applications.
Latest
function hyphenate
import { hyphenate } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/string/index.js";

Replaces the spaces between non-empty characters of the string with hyphens (-).

Examples

Example 1

import { hyphenate } from "@ayonli/jsext/string";

console.log(hyphenate("hello world")); // hello-world
console.log(hyphenate("hello   world")); // hello-world