Function slice

  • Negative indices count backwards from the beginning of the array. Like the built-in String.slice(), the slice does not include the index at the end.

    Remarks

    Returns an empty string if an index is fractional or NaN.

    Example

    ```ts import * as S from "flurp/string";

    const f = S.slice(2); const g = S.slice(-2); const h = S.slice(2, 3); f("weasel"); // "asel" g("weasel"); // "el" h("weasel"); // "a"

    Parameters

    • start: number
    • Optional end: number

    Returns ((_: string) => string)

      • (_: string): string
      • Parameters

        • _: string

        Returns string