Function split

  • It will split string by separator.

    Parameters

    • string: string
    • separator: string | RegExp = ""
    • Optional limit: number

    Returns string[]

    Since

    1.0.0

    Example

    split("012345");
    // => ["0", "1", "2", "3", "4", "5"]

    Example

    split("0,1,2,3,4,5", ",");
    // => ["0", "1", "2", "3", "4", "5"]

    Example

    split("0,1,2,3,4,5", ",", 2);
    // => ["0", "1"]