powered by
Given a character vector, str_left() returns the left side of a string.
str_left()
str_left(string, n = 1)
A character vector
The character from which the left portion will be returned.
Optional. The number of characters to return from the left side of string
str_right() which extracts characters from the right and str_mid() which returns a segment of character strings.
str_right()
str_mid()
str_left("Nigeria") str_left("Nigeria", n = 3) str_left(c("Female", "Male", "Male", "Female"))
Run the code above in your browser using DataLab