str_transform

Share:

Description

Convert a string by applying one or more str_* functions.

Usage

1
str_transform(string, ...)

Arguments

string

vector. This must be an atomic vector, and will be coerced to a character vector

...

one or more functions to apply to the string

Details

str_transform applies successive functions to its first argument, string.

Value

a character vector

See Also

make_str_replace make_str_delete

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
string = c( "catch-22", "finnegans wake" )
  str_transform( string, str_capitalize )

  str_transform( string, str_capitalize, str_delete_nonword )
  str_delete_nonword( str_capitalize( string ) )      # SAME

  ## Not run: 
    # magrittr:
    string %>% str_capitalize %>% str_delete_nonword   # SAME
  
## End(Not run)