43. implement Trim<T>

TypeScript
Is this helpful ?

  - accepted / - tried

Please implement Trim<T> just like String.prototype.trim().

type A = Trim<'    BFE.dev'> // 'BFE'
type B = Trim<' BFE. dev  '> // 'BFE. dev'
type C = Trim<'  BFE .   dev  '> // 'BFE .   dev'

Let's try to solve this problem within 10 minutes.

Discuss(4)