• Iterates over a range of characters.

    Only the first character of the initialCharacter will be used.

    If initialCharacter is empty, the sequence will start with rangeStart if stepSize is positive, or rangeEnd if stepSize is negative.

    If stepSize is 0 the sequence is empty.

    Example

    Iterate over uppercaseAsciiLetterRange

    for (const c of characterSequence(uppercaseAsciiLetterRange)) {
    console.log(c); // 'A','B',...,'Z'
    }

    Example

    Start at letter 'D' and iterate backwards

    for (const c of characterSequence(uppercaseAsciiLetterRange, 'D', -1)) {
    console.log(c); // 'D','C','B','A'
    }

    Example

    Create a character Array

    const a = [...characterSequence(uppercaseAsciiLetterRange, 'V', 2)];
    console.log(a); // ['V', 'X', 'Z']

    Returns

    an Iterable that iterates through the characters

    Parameters

    • __namedParameters: CharCodeRange
    • initialCharacter: string = ""
    • stepSize: number = 1
    • charCode: CharCode = ...

    Returns Iterable<string>

Generated using TypeDoc