Learn R Programming

lettercase (version 0.13.1)

str_ucfirst: str_ucfirst

Description

Convert first character of a string to uppercase

Usage

str_ucfirst(string)
is_ucfirst(string)

Arguments

string
character vector to be converted.

See Also

str_title_case

Examples

Run this code
str_ucfirst( "one flew over the cuckoo's nest" )
 str_ucfirst( "catch-22" )
 str_ucfirst( "Portrait of the Artist as a Young Man" )
# is_ucfirst
  is_ucfirst( 'ABC123' )      # TRUE
  is_ucfirst( 'abc123' )      # FALSE
  is_ucfirst( 'aBC'  )        # FALSE
  is_ucfirst( 'Abc' )         # TRUE
  is_ucfirst( 'Abc dEF' )     # FALSE
  is_ucfirst( '123' )         # TRUE

Run the code above in your browser using DataLab