Function padLeft

  • Example

    import * as S from "flurp/string";

    const leftDot = S.padLeft("10, ".");
    const leftMulti = S.padLeft(10, "_.");
    leftDot("weasel"); // "....weasel"
    leftDot("grayweasel") // "grayweasel"
    leftMulti("weasel") // "_._.weasel";
    leftMulti("aweasel") // "_._aweasel";

    Parameters

    • len: number
    • str: string = " "

      padding string (defaults to " ")

    Returns ((s: string) => null | string)

      • (s: string): null | string
      • Parameters

        • s: string

        Returns null | string