Learn R Programming

stringr (version 0.6.2)

str_length: The length of a string (in characters).

Description

The length of a string (in characters).

Usage

str_length(string)

Arguments

string
input vector. This must be an atomic vector, and will be coerced to a character vector

Value

  • numeric vector giving number of characters in each element of the character vector. Missing string have missing length.

See Also

nchar which this function wraps

Examples

Run this code
str_length(letters)
str_length(c("i", "like", "programming", NA))

Run the code above in your browser using DataLab