Skip to main content
Module

x/fun/string.ts>trimEnd

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

Trims whitespace from the end of a string.

Examples

Example 1

import { trimEnd } from "./string.ts";

const result1 = trimEnd("Hello World"); // "Hello World"
const result2 = trimEnd("  Hello World"); // "Hello World"
const result3 = trimEnd("Hello World  "); // "Hello World"
const result4 = trimEnd(" Hello World "); // "Hello World"

Parameters

a: string

Returns

string