center_string: Center all lines of a string relative to console width.

View source: R/textshapes.R

center_stringR Documentation

Center all lines of a string relative to console width.

Description

Center all lines of a string relative to console width.

Usage

center_string(string, remove_last_break = TRUE, display = FALSE)

Arguments

string

(character) Some text to center within console.

remove_last_break

(logical) Set to TRUE to remove last line break. Defaults to FALSE.

display

(logical) Returns string invisibly if FALSE (default), set to TRUE to display returned string

Details

To removes last line break set removelastbreak to TRUE.

Value

A string

Examples

triangle_string(starwars_intro, display = TRUE) %>%
  center_string() %>%
  multi_color(direction = "horizontal", recycle_chars = TRUE)

multicolor documentation built on March 7, 2023, 7:30 p.m.