stringr (version 0.3)

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

Description

The length of a string (in characters).

Usage

str_length(string)

Arguments

string
input 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 DataCamp Workspace