Pattern matching

Control matching behaviour with modifier functions.

Count the number of matches in a string.

Detect the presence or absence of a pattern in a string.

Extract matching patterns from a string.

Locate the position of patterns in a string.

Extract matched groups from a string.

Replace matched patterns in a string.

Split up a string into pieces.

Keep strings matching a pattern, or find positions.

View HTML rendering of regular expression match.

Whitespace

Pad a string.

Trim whitespace from start and end of string.

Wrap strings into nicely formatted paragraphs.

Locale senstive

Convert case of a string.

Order or sort a character vector.

Other helpers

Switch location of matches to location of non-matches.

Join multiple strings into a single string.

Specify the encoding of a string.

Duplicate and concatenate strings within a character vector.

String interpolation.

The length of a string.

Turn NA into "NA"

Extract and replace substrings from a character vector.

Truncate a character string.

Extract words from a sentence.

Bundled data

Sample character vectors for practicing string manipulations.