Skip to main content
Module

x/fun/mod.ts>string.trimEnd

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

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