Skip to contents

Apply str_to_upper to strings with number of characters lower than "n_abb".

Usage

str_to_abb(string, n_abb = 3)

Arguments

string

A character vector

n_abb

A numeric integer single value (default = 3), that will be the number of characters to define as an abbreviation

Value

A character vector.

Examples


string <- c("aaaaa","bb","ccc","dddd")

str_to_abb(string)
#> [1] "Aaaaa" "BB"    "CCC"   "Dddd"