• Tries to parse an Integer from a String

    Example

    Parse Integer

    const i = parseInteger("1");
    console.log(i); // 1

    Example

    Parse the first valid Integer

    const i = parseInteger(" 3.4a");
    console.log(i); // 3

    Returns

    the parsed Iloat if successful, otherwise undefined

    Parameters

    • str: string

    Returns undefined | number

Generated using TypeDoc