Learn R Programming

multicolor (version 0.1.7)

center_string: 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)

Value

A string

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.

Examples

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

Run the code above in your browser using DataLab