Skip to content

trim ​

ts
function String.trim<T extends string>(target: T): Trim<T>

Removes whitespace from both ends of target string.

Example ​

ts
import { String } from "@monstermann/string";

String.trim("  hello world  "); // "hello world"
ts
import { String } from "@monstermann/string";

pipe("  hello world  ", String.trim()); // "hello world"