ts-type-forge
    Preparing search index...

    Type Alias Alphabet

    Represents the set of both lowercase and uppercase English alphabet letters. A union of LowerAlphabet and UpperAlphabet, covering all 52 English letters.

    Useful for general alphabetic character validation, text processing, and type-safe operations that work with any English letter.

    type AlphabetCount = 52; // LowerAlphabet (26) + UpperAlphabet (26)

    const isAlphabetic = (char: string): char is Alphabet => {
    return char.length === 1 &&
    ((char >= 'a' && char <= 'z') || (char >= 'A' && char <= 'Z'));
    };

    type ExtractAlpha<S extends string> = S extends `${infer F}${infer R}`
    ? F extends Alphabet
    ? `${F}${ExtractAlpha<R>}`
    : ExtractAlpha<R>
    : '';

    type OnlyLetters = ExtractAlpha<'H3ll0 W0rld!'>; // 'HllWorld'