processString | R Documentation |
Processes a given input string by applying optional trimming, case conversion, and ASCII transliteration.
processString(input, processor = TRUE, asciify = FALSE)
input |
A |
processor |
A |
asciify |
A |
The function applies the following transformations to the input string, in this order:
Trimming (if processor = TRUE
): Removes leading and trailing whitespace.
Lowercasing (if processor = TRUE
): Converts all characters to lowercase.
ASCII Transliteration (if asciify = TRUE
): Replaces accented or special characters with their closest ASCII equivalents.
A std::string
representing the processed string.
# Example usage
processString(" Éxâmple! ", processor = TRUE, asciify = TRUE)
# Returns: "example!"
processString(" Éxâmple! ", processor = TRUE, asciify = FALSE)
# Returns: "éxâmple!"
processString(" Éxâmple! ", processor = FALSE, asciify = TRUE)
# Returns: "Éxâmple!"
processString(" Éxâmple! ", processor = FALSE, asciify = FALSE)
# Returns: " Éxâmple! "
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.