import { truncate } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/string/index.js";
Truncates the string to the given length (including the ending ...
).
Examples
Example 1
Example 1
import { truncate } from "@ayonli/jsext/string";
console.log(truncate("hello world", 8)); // hello...
console.log(truncate("hello world", 11)); // hello world