Skip to contents

Given a character vector, str_right() returns the right side of a string.

Usage

str_right(string, n = 1)

Arguments

string

The character from which the right portion will be returned.

n

Optional. The number of characters to return from the right side of string.

Value

A character vector.

See also

str_left() which extracts characters from the left and str_mid() which returns a segment of character strings.

Examples

str_right("Sale Price")
#> [1] "e"

str_right("Sale Price", n = 5)
#> [1] "Price"