Type alias StringEndsWith<T, U>

StringEndsWith<T, U>: IfExtends<T, `${string}${U}`, true, false>

Check if a string ends with another string

Type Parameters

  • T extends string
  • U extends string

Example

type Result = StringEndsWith<'hello world', 'world'>; // Result: true