Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/simple_utility/src/pure/text.ts>trimExtend

Simplify processing for Deno.
Go to Latest
function trimExtend
import { trimExtend } from "https://deno.land/x/simple_utility@v2.0.9/src/pure/text.ts";

Trim head and tail blank, remove CR and consecutive space (tab, LF) to single space (tab, LF).

Examples

Example 1

const format = trimExtend("  Lorem ipsum\r dolor   sit  \r\r amet. ");

Parameters

data: string

Returns

string