Simple, Consistent Wrappers for Common String Operations
Convert string to upper case, lower case, title case, or sentence case
Switch location of matches to location of non-matches
Control matching behaviour with modifier functions
Pipe operator
Join multiple strings into one string
Specify the encoding of a string
Count number of matches
Detect the presence/absence of a match
Duplicate a string
Determine if two strings are equivalent
Escape regular expression metacharacters
Extract the complete match
Flatten a string
Interpolation with glue
String interpolation
Compute the length/width
Detect a pattern in the same way as SQL
's LIKE
operator
Find location of match
Extract components (capturing groups) from a match
Order, rank, or sort a character vector
Pad a string to minimum width
Remove matched patterns
Replace matches with new text
Turn NA into "NA"
Split up a string into pieces
Detect the presence/absence of a match at the start/end
Get and set substrings using their positions
Find matching elements
Remove whitespace
Truncate a string to maximum width
Remove duplicated strings
View strings and matches
Find matching indices
Wrap words into nicely formatted paragraphs
Sample character vectors for practicing string manipulations
stringr: Simple, Consistent Wrappers for Common String Operations
Extract words from a sentence
A consistent, simple and easy to use set of wrappers around the fantastic 'stringi' package. All function and argument names (and positions) are consistent, all functions deal with "NA"'s and zero length vectors in the same way, and the output from one function is easy to feed into the input of another.
Useful links