effect-io-ai

Package: effect
Module: String

String.TrimEnd

Type-level representation of trimming whitespace from the end of a string.

Example (Trimming trailing whitespace at the type level)

import type { String } from "effect"

type Result = String.TrimEnd<"hello  "> // "hello"

Signature

type TrimEnd<A> = A extends `${infer B}${" " | "\n" | "\t" | "\r"}` ? TrimEnd<B> : A

Source

Since v2.0.0