Skip to content

ensureEndsWith

Ensures that a string ends with the specified suffix, adding it if necessary.

Import:

import { ensureEndsWith } from '@mnaoumov/typescript-lib/string';

Signature:

function ensureEndsWith(params: EnsureEndsWithParams): string

Parameters:

Parameter Type Description
params EnsureEndsWithParams The parameters.

Returns: string — The string that ends with the suffix.


Links to this page: