@tempots/std

filterChars() function

filterString applies predicate character by character to s and it returns a filtered version of the string.

Signature:

filterChars: (s: string, predicate: (s: string) => boolean) => string

Parameters

Parameter

Type

Description

s

string

The string to filter.

predicate

(s: string) => boolean

The function to apply to each character in the string.

Returns: string

The filtered string.