processString {RapidFuzz} | R Documentation |
Process a String
Description
Processes a given input string by applying optional trimming, case conversion, and ASCII transliteration.
Usage
processString(input, processor = TRUE, asciify = FALSE)
Arguments
input |
A |
processor |
A |
asciify |
A |
Details
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.
Value
A std::string
representing the processed string.
Examples
# 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! "