Strings.stripEnd()

Syntax

function stripEnd(from: string, ...what: string[]): string

Returns a new string with all the specified tokens removed from the end of the string.

Parameters
from

The string to strip.

what Rest

The tokens to remove from the end of from if found. If not specified, the function will return the original string.

Example

import { Strings } from 'potence';

const string = 'nononoyesnono';

Strings.stripEnd(string, 'no');  // -> "nononoyes"

Remarks

Compare Strings.stripStart().