stringCleanup function

Remove Undesired Characters From Strings

Remove Undesired Characters From Strings

These functions are utilities to clear undesired characters from REDCap output.

stripHTMLTags( x, tags = c("p", "br", "div", "span", "b", "font", "sup", "sub"), ignore.case = TRUE ) stripUnicode(x)

Arguments

  • x: character, vector of content to be cleaned.
  • tags: character, vector of HTML tags to remove from x
  • ignore.case: logical(1), should cases be ignored when matching patterns? Defaults to TRUE.

Returns

stripHTMLTags returns a character vector.

stripUnicode returns a character vector.

Examples

stripHTMLTags("<p>Text in a paragraph <b>tag</b> with bold formatting </p>") stripUnicode("\U00B5 = 0")
  • Maintainer: Shawn Garbett
  • License: GPL-2
  • Last published: 2024-10-17