Pattern matching |
|
---|---|
String |
|
Count number of matches |
|
Detect the presence/absence of a match |
|
Escape regular expression metacharacters |
|
Extract the complete match |
|
Find location of match |
|
Extract components (capturing groups) from a match |
|
Replace matches with new text |
|
Remove matched patterns |
|
Split up a string into pieces |
|
Detect the presence/absence of a match at the start/end |
|
Control matching behaviour with modifier functions |
|
VectorUnlike other pattern matching functions, these functions operate on the original character vector, not the individual matches. |
|
Find matching elements |
|
Find matching indices |
|
Combining strings |
|
Join multiple strings into one string |
|
Flatten a string |
|
Interpolation with glue |
|
Character based |
|
Duplicate a string |
|
Compute the length/width |
|
Pad a string to minimum width |
|
Get and set substrings using their positions |
|
Remove whitespace |
|
Truncate a string to maximum width |
|
Wrap words into nicely formatted paragraphs |
|
Locale aware |
|
Order, rank, or sort a character vector |
|
Determine if two strings are equivalent |
|
|
Convert string to upper case, lower case, title case, or sentence case |
Remove duplicated strings |
|
Other helpers |
|
Switch location of matches to location of non-matches |
|
Specify the encoding of a string |
|
Detect a pattern in the same way as |
|
Turn NA into "NA" |
|
View strings and matches |
|
Extract words from a sentence |
|
Bundled data |
|
Sample character vectors for practicing string manipulations |