cass_highlight: Takes a character vector and returns it with matches of...

View source: R/cass_highlight.R

cass_highlightR Documentation

Takes a character vector and returns it with matches of pattern wrapped in html tags used for highlighting

Description

Takes a character vector and returns it with matches of pattern wrapped in html tags used for highlighting

Usage

cass_highlight(string, pattern, ignore_case = TRUE)

Arguments

string

A character vector.

ignore_case

Defaults to TRUE.

param

Pattern to match.

Value

A character vector, fo the same length as the input string. Matched words are bound by the html ⁠<mark>⁠ tag.

Examples

cass_highlight(
  string = c(
    "The R Foundation for Statistical Computing",
    "R is free software and comes with ABSOLUTELY NO WARRANTY"
  ),
  pattern = "foundation|software|warranty"
)

giocomai/castarter documentation built on June 12, 2025, 8:49 p.m.