Skip to content

hasSingleOccurrence

Checks if a string has a single occurrence of a search value.

Import:

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

Signature:

function hasSingleOccurrence(params: HasSingleOccurrenceParams): boolean

Parameters:

ParameterTypeDescription
paramsHasSingleOccurrenceParamsThe parameters.

Returns: booleantrue if the string has a single occurrence of the search value, false otherwise.


Links to this page: