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

View source: R/rjust.R

strs_rjustR Documentation

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 = " ")

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.

Value

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

See Also

Python str.rjust() documentation

Examples

strs_rjust("hello", 10)
strs_rjust("world", 10, "*")

strs documentation built on Sept. 11, 2024, 6:44 p.m.