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): stringParameters:
| Parameter | Type | Description |
|---|---|---|
params |
EnsureStartsWithParams | The parameters. |
Returns: string — The string that starts with the prefix.
Links to this page: