Learn R Programming

⚠️There's a newer version (1.5.1) of this package.Take me there.

stringr (version 0.1.10)

Make it easier to work with strings.

Description

stringr is a set of simple wrappers that make R's string functions more consistent, simpler and easier to use. It does this by ensuring that: function and argument names (and positions) are consistent, all functions deal with NA's and zero length character appropriately, and the output data structures from each function matches the input data structures of other functions.

Copy Link

Version

Install

install.packages('stringr')

Monthly Downloads

1,232,548

Version

0.1.10

License

GPL-2

Maintainer

Hadley Wickham

Last Published

November 9th, 2009

Functions in stringr (0.1.10)

str_trim

Trim whitespace from start and end of string...
str_match

Extract first matched group from a string...
str_join

Join multiple strings into a single string...
str_locate

Locate the position of the first occurence of a pattern in a string.
str_extract

Extract first piece of a string that matches a pattern.
str_extract_all

Extract all pieces of a string that match a pattern.
str_sub

Extract substrings from a character vector...
str_match_all

Extract all matched groups from a string...
str_replace

Replace replaced occurences of a matched pattern in a string.
str_locate_all

Locate the position of all occurences of a pattern in a string.
str_length

The length of a string (in characters)...
str_pad

Pad a string...
str_split

Split up a string by a pattern...
str_detect

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

Duplicate strings within a character vector...