Skip to content

ensureStartsWith

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

Import:

import { ensureStartsWith } from 'obsidian-dev-utils/string';

Signature:

function ensureStartsWith(params: EnsureStartsWithParams): string

Parameters:

ParameterTypeDescription
paramsEnsureStartsWithParamsThe parameters.

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


Links to this page: