50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

strs (version 0.1.0)

strs_rjust: Right-justify string in a field of a given width

Description

strs_rjust right-justifies each element of a character vector in a field of a specified width. It is similar to Python's str.rjust() method.

Usage

strs_rjust(string, width, fillchar = " ")

Value

A character vector of the same length as string, with each element right-justified in a field of the specified width.

Arguments

string

A character vector where each element is a string to be right-justified.

width

The total width of the field in which the string is to be right-justified.

fillchar

A character used for padding on the left.

See Also

Examples

Run this code
strs_rjust("hello", 10)
strs_rjust("world", 10, "*")

Run the code above in your browser using DataLab