Package: stringr 1.6.0.9000

Hadley Wickham

stringr: Simple, Consistent Wrappers for Common String Operations

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.

Authors:Hadley Wickham [aut, cre, cph], Posit Software, PBC [cph, fnd]

stringr_1.6.0.9000.tar.gz
stringr_1.6.0.9000.zip(r-4.6)stringr_1.6.0.9000.zip(r-4.5)stringr_1.6.0.9000.zip(r-4.4)
stringr_1.6.0.9000.tgz(r-4.6-any)stringr_1.6.0.9000.tgz(r-4.5-any)
stringr_1.6.0.9000.tar.gz(r-4.6-any)stringr_1.6.0.9000.tar.gz(r-4.5-any)
stringr_1.6.0.9000.tgz(r-4.5-emscripten)
stringr.pdf |stringr.html
stringr/json (API)
NEWS

# Install 'stringr' in R:
install.packages('stringr', repos = c('https://tidyverse.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/tidyverse/stringr/issues

Pkgdown/docs site:https://stringr.tidyverse.org

Datasets:
  • fruit - Sample character vectors for practicing string manipulations
  • sentences - Sample character vectors for practicing string manipulations
  • words - Sample character vectors for practicing string manipulations

On CRAN:

Conda:

regular-expressionstrings

21.71 score 656 stars 8.9k packages 208k scripts 1.5M downloads 63 exports 7 dependencies

Last updated from:ae054b1d28. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesLog
linux-devel-x86_64OK134
source / vignettesOK247
linux-release-x86_64OK163
macos-devel-arm64OK94
macos-release-arm64OK111
windows-develOK82
windows-releaseOK109
windows-oldrelOK93
wasm-releaseOK126

Exports:%>%boundarycollfixedinvert_matchregexstr_cstr_convstr_countstr_detectstr_dupstr_endsstr_equalstr_escapestr_extractstr_extract_allstr_flattenstr_flatten_commastr_gluestr_glue_datastr_ilikestr_interpstr_lengthstr_likestr_locatestr_locate_allstr_matchstr_match_allstr_orderstr_padstr_rankstr_removestr_remove_allstr_replacestr_replace_allstr_replace_nastr_sortstr_splitstr_split_1str_split_fixedstr_split_istr_squishstr_startsstr_substr_sub_allstr_sub<-str_subsetstr_to_camelstr_to_kebabstr_to_lowerstr_to_sentencestr_to_snakestr_to_titlestr_to_upperstr_trimstr_truncstr_uniquestr_viewstr_view_allstr_whichstr_widthstr_wrapword

Dependencies:cligluelifecyclemagrittrrlangstringivctrs

From base R

Rendered fromfrom-base.Rmdusingknitr::rmarkdownon Feb 08 2026.

Last update: 2025-09-05
Started: 2019-05-14

Introduction to stringr

Rendered fromstringr.Rmdusingknitr::rmarkdownon Feb 08 2026.

Last update: 2024-08-15
Started: 2014-11-28

Locale sensitive functions

Rendered fromlocale-sensitive.Rmdusingknitr::rmarkdownon Feb 08 2026.

Last update: 2025-09-22
Started: 2025-09-22

Regular expressions

Rendered fromregular-expressions.Rmdusingknitr::rmarkdownon Feb 08 2026.

Last update: 2025-09-19
Started: 2016-10-16

Readme and manuals

Help Manual

Help pageTopics
Convert string to upper case, lower case, title case, or sentence casecase str_to_lower str_to_sentence str_to_title str_to_upper
Switch location of matches to location of non-matchesinvert_match
Control matching behaviour with modifier functionsboundary coll fixed modifiers regex
Join multiple strings into one stringstr_c
Specify the encoding of a stringstr_conv
Count number of matchesstr_count
Detect the presence/absence of a matchstr_detect
Duplicate a stringstr_dup
Determine if two strings are equivalentstr_equal
Escape regular expression metacharactersstr_escape
Extract the complete matchstr_extract str_extract_all
Flatten a stringstr_flatten str_flatten_comma
Interpolation with gluestr_glue str_glue_data
Compute the length/widthstr_length str_width
Detect a pattern in the same way as 'SQL''s 'LIKE' and 'ILIKE' operatorsstr_ilike str_like
Find location of matchstr_locate str_locate_all
Extract components (capturing groups) from a matchstr_match str_match_all
Order, rank, or sort a character vectorstr_order str_rank str_sort
Pad a string to minimum widthstr_pad
Remove matched patternsstr_remove str_remove_all
Replace matches with new textstr_replace str_replace_all
Turn NA into "NA"str_replace_na
Split up a string into piecesstr_split str_split_1 str_split_fixed str_split_i
Detect the presence/absence of a match at the start/endstr_ends str_starts
Get and set substrings using their positionsstr_sub str_sub<- str_sub_all
Find matching elementsstr_subset
Convert between different types of programming casestr_to_camel str_to_kebab str_to_snake
Remove whitespacestr_squish str_trim
Truncate a string to maximum widthstr_trunc
Remove duplicated stringsstr_unique
View strings and matchesstr_view str_view_all
Find matching indicesstr_which
Wrap words into nicely formatted paragraphsstr_wrap
Sample character vectors for practicing string manipulationsfruit sentences stringr-data words
Extract words from a sentenceword