pad_string: Pad String with Spaces

View source: R/ubiquity.r

pad_stringR Documentation

Pad String with Spaces

Description

Adds spaces to the beginning or end of strings until it reaches the maxlength. Used for aligning text.

Usage

pad_string(str, maxlength = 1, location = "beginning")

Arguments

str

string

maxlength

length to pad to

location

either "beginning" to pad the left or "end" to pad the right

Value

Padded string

Examples

pad_string("bob", maxlength=10)
pad_string("bob", maxlength=10, location="end")

john-harrold/ubiquity documentation built on March 13, 2024, 2:58 a.m.