Common string transformations

Share:

Description

Perform common transformations on strings

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

Arguments

string

character vector

These function take a single character vector argument and return a character vector that has had one or more functions applied to it. They are the building blocks for building up case transformations.

Value

character vector

Examples

1
2
3
4
5
6
7
8
# TRANSFORMATIONS
  str_ucfirst( "abc def" )              # Abc Def
  str_expand_capwords( "AbcDef")        # Abc Def

# DELETION
  str_delete_whitespace( "ABC 123" )    # ABC123
  str_delete_separators( "A_B-C.123" )  # ABC123
  str_delete_nonword( "ABC & 123" )     # ABC123