Learn R Programming

ifultools (version 2.0-26)

properCase: Case conversion ala a proper noun

Description

Converts a character string with arbitrary case to a character string whose first character is capitalized and remaining characters are set to lower case.

Usage

properCase(x, pre="", post="", sep="")

Value

a vector of character strings containing the result. The length of this vector is equal to length(x).

Arguments

x

a character string or vector of character strings.

post

a character string to append to each character string in x after conversion. Default: "".

pre

a character string to prepend to each character string in x after conversion. Default: "".

sep

a character string that is pasted between the other portions of the combined string ala pre-sep-formatted x-sep-post. Default: "".

See Also

ordinal.

Examples

Run this code
## produces "myBasketBall" "mySoccerBall" 
## "myFootBall" 
properCase(c("baSkeT","SoCcEr","foot"),post="Ball",pre="my")

Run the code above in your browser using DataLab