str_cap_words

Share:

Description

Function used to convert character vectors to CapWord format.

Usage

1
str_cap_words(string)

Arguments

string

character vector to turn into a CapWords

CapWords is distinguished by:

  1. All words with upper case first character

  2. No non-word characters allowed (letters/numbers only allowed)

The recipe for chaging into capwords is:

  1. replace whitespace and other word separators with space

  2. str_ucfirst

  3. strstdelete whitespace

Examples

1
2
3
# CAP WORDS
    str_cap_words( "One Flew Over The Cuckoo's Nest" )
    str_cap_words( "Catch-22" )  # CATCH