Function trimEnd

Removes given characters from the end of the string. See also: trim and trimStart.

trimEnd("abcxzyz", "yz"); // "abcxz"
trimEnd("!aaa!!", "!"); // "!aaa"
  • Parameters

    • source: string

      Source string.

    • characters: string

      Characters to remove, taken as a whole.

    Returns string