Skip to content

hasSingleOccurrence

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

Import:

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

Signature:

function hasSingleOccurrence(params: HasSingleOccurrenceParams): boolean

Parameters:

Parameter Type Description
params HasSingleOccurrenceParams The parameters.

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


Links to this page: