import { string } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { trim } = string;
Trims whitespace from the beginning and end of a string.
Examples
Example 1
Example 1
import { trim } from "./string.ts";
const result1 = trim("Hello World"); // "Hello World"
const result2 = trim(" Hello World"); // "Hello World"
const result3 = trim("Hello World "); // "Hello World"
const result4 = trim(" Hello World "); // "Hello World"