❯ ~/robonen/tools
core
  • stdlibapi
    ❯
    guide
    • Introduction
    • ❯AnyFunction
    • ❯Arrayable
    • ❯Collection
    • ❯HasSpaces
    • ❯isArray
    • ❯isBigInt
    • ❯isBoolean
    • ❯isDate
    • ❯isError
    • ❯isFunction
    • ❯isMap
    • ❯isNull
    • ❯isNumber
    • ❯isObject
    • ❯isPromise
    • ❯isRegExp
    • ❯isSet
    • ❯isString
    • ❯isSymbol
    • ❯isUndefined
    • ❯isWeakMap
    • ❯isWeakSet
    • ❯MaybePromise
    • ❯Path
    • ❯PathToPartialType
    • ❯PathToType
    • ❯ReadonlyArrayable
    • ❯Stringable
    • ❯toString
    • ❯Trim
    • ❯UnionToIntersection
    • ❯VoidFunction
    • ❯Whitespace
  • platformapi
  • fetchapi
  • encodingapi
  • crdtapi
vue
  • vueapi
  • writekitapi
  • primitivesui
configs
  • eslintguide
  • tsconfigguide
  • tsdownguide
infra
  • renovateguide
@robonen/stdlib/Trim
T

Trim

Trim leading and trailing whitespace from S

Source

Signature

ts
export type Trim<S extends string>
  = S extends `${Whitespace}${infer R}`
    ? Trim<R>
    : S extends `${infer L}${Whitespace}`
      ? Trim<L>
      : S;

Type Parameters

Sextends string
on this page
  • Signature
  • Type Parameters