Learn R Programming

lettercase (version 0.13.1)

str_cap_words: str_cap_words

Description

Function used to convert character vectors to CapWord format.

Usage

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

Run this code
# CAP WORDS
    str_cap_words( "One Flew Over The Cuckoo's Nest" )
    str_cap_words( "Catch-22" )  # CATCH

Run the code above in your browser using DataLab