35252-medium-isalphabet

Back

type IsAlphabet<S extends string> = Uppercase<S> extends Lowercase<S> ? false : true

Playground

type IsAlphabet<S extends string> = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' extends
  `${any}${S & `${any}${any}`}${any}` ? true : false

Playground

Solution by teamchong #35257