Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 614 Bytes

trimEnd.md

File metadata and controls

33 lines (21 loc) · 614 Bytes

strings.trimEnd

trimEnd([string], [chars=' '])

TrimEnd trims any whitespace or the selected characters from the end of the string

Arguments

  1. [string] (string): input string
  2. [chars=' '] (string): characters to remove from end of the string

Returns

(string): string with the characters removed from end of the string

Example

const result = strings.trimEnd('-_-abc-_-', '_-');
console.log(result);
> '-_-abc'