String: Trim Right

Medium
conditional types
template literal
infer
recursive

Description:

Implement TrimRight<T> which takes an exact string type and returns a new string with the whitespace ending removed.

For example:

type Trimed = TrimRight<' Hello World '> // expected to be ' Hello World'

Code

Loading...