Skip to content

ensureStartsWith

Ensures that a string starts with the specified prefix, adding it if necessary.

Import:

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

Signature:

function ensureStartsWith(params: EnsureStartsWithParams): string

Parameters:

Parameter Type Description
params EnsureStartsWithParams The parameters.

Returns: string — The string that starts with the prefix.


Links to this page: