Technically this returns the number of "code points", in a string. One code point usually corresponds to one character, but not always. For example, an u with a umlaut might be represented as a single character or as the combination a u and an umlaut.

str_length(string)

## Arguments

string Input vector. Either a character vector, or something coercible to one.

## Value

A numeric vector giving number of characters (code points) in each element of the character vector. Missing string have missing length.

stringi::stri_length() which this function wraps.
str_length(letters)#>  [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1str_length(NA)#> [1] NAstr_length(factor("abc"))#> [1] 3str_length(c("i", "like", "programming", NA))#> [1]  1  4 11 NA
str_count(u1)#> [1] 1str_count(u2)#> [1] 1