capitalize
From R.utils v1.6.2
by Henrik Bengtsson
Capitalizes/decapitalizes each character string in a vector
Capitalizes/decapitalized (making the first letter upper/lower case) of each character string in a vector.
- Keywords
- programming
Usage
## S3 method for class 'default':
capitalize(str, ...)
## S3 method for class 'default':
decapitalize(str, ...)
Arguments
Value
See Also
Examples
words <- strsplit("Hello wOrld", "")[[1]];
cat(paste(toupper(words), collapse=""), "") # "HELLO WORLD"
cat(paste(tolower(words), collapse=""), "") # "hello world"
cat(paste(capitalize(words), collapse=""), "") # "Hello WOrld"
cat(paste(decapitalize(words), collapse=""), "") # "hello wOrld"
Community examples
Looks like there are no examples yet.