apply_to_chars: Apply a function to each character in a string.

View source: R/tokenization.R

apply_to_charsR Documentation

Apply a function to each character in a string.

Description

Utility function for something done a lot in this package.

Usage

apply_to_chars(text, .f, ...)

Arguments

text

A character scalar to process.

.f

The function to apply to each character. Should return a character scalar, given a single-character input.

...

Other arguments to pass to .f.

Value

The character scalar obtained by applying the given function to each character of the input string, and concatenating the results.


jonathanbratt/RBERT documentation built on Jan. 26, 2023, 4:15 p.m.