effect-io-ai

Package: effect
Module: String

String.trim

Removes whitespace from both ends of a string.

Example (Trimming whitespace)

import { String } from "effect"
import * as assert from "node:assert"

assert.deepStrictEqual(String.trim(" a "), "a")
assert.deepStrictEqual(String.trim("  hello world  "), "hello world")

Signature

declare const trim: <A extends string>(self: A) => Trim<A>

Source

Since v2.0.0