Learn R Programming

textpress (version 1.0.0)

.insert_highlight: Insert Highlight in Text

Description

Inserts highlight markers around a specified substring in a text string. Used to visually emphasize search query matches in the text.

Usage

.insert_highlight(text, start, end, highlight)

Value

A character string with the specified substring highlighted.

Arguments

text

The text string where highlighting is to be applied.

start

The starting position of the substring to highlight.

end

The ending position of the substring to highlight.

highlight

A character vector of length two specifying the opening and closing highlight markers.