Function startsWith

  • It will check whether the string starts with the given searchString.

    Parameters

    • string: string
    • searchString: string
    • position: number = 0

    Returns boolean

    Since

    1.0.0

    Example

    startsWith("012345", "012");
    // => true

    Example

    startsWith("012345", "12");
    // => false

    Example

    startsWith("012345", "234", 2);
    // => true