Skip to main content
Module

x/fun/string.ts>trim

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function trim
import { trim } from "https://deno.land/x/fun@v2.0.0/string.ts";

Trims whitespace from the beginning and end of a string.

Examples

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"

Parameters

a: string

Returns

string