Learn R Programming

forstringr (version 1.0.0)

str_right: Returns a substring from the end of a specified string

Description

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

Usage

str_right(string, n = 1)

Value

A character vector.

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.

See Also

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

Examples

Run this code
str_right("Sale Price")

str_right("Sale Price", n = 5)

Run the code above in your browser using DataLab