Function endsWith

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

    Parameters

    • string: string
    • searchString: string
    • endPosition: number = string.length

    Returns boolean

    Since

    1.0.0

    Example

    endsWith("012345", "345");
    // => true

    Example

    endsWith("012345", "34");
    // => false

    Example

    endsWith("012345", "123", 4);
    // => true