GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — cli/man/ansi_strwrap.Rd at main · multimeric/cli Expand file tree/ Copy pathansi_strwrap.RdMore file actions 58 lines (53 loc) · 1.52 KB / Copy pathansi_strwrap.RdFile metadata and controls58 lines (53 loc) · 1.52 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 % Generated by roxygen2: do not edit by hand % Please edit documentation in R/ansiex.R \name{ansi_strwrap} \alias{ansi_strwrap} \title{Wrap an ANSI styled string to a certain width} \usage{ ansi_strwrap( x, width = console_width(), indent = 0, exdent = 0, simplify = TRUE ) } \arguments{ \item{x}{ANSI string.} \item{width}{Width to wrap to.} \item{indent}{Indentation of the first line of each paragraph.} \item{exdent}{Indentation of the subsequent lines of each paragraph.} \item{simplify}{Whether to return all wrapped strings in a single character vector, or wrap each element of \code{x} independently and return a list.} } \value{ If \code{simplify} is \code{FALSE}, then a list of character vectors, each an ANSI string. Otherwise a single ANSI string vector. } \description{ This function is similar to \code{\link[base:strwrap]{base::strwrap()}}, but works on ANSI styled strings, and leaves the styling intact. } \examples{ text <- cli:::lorem_ipsum() # Highlight some words, that start with 's' rexp <- gregexpr("\\\\b([sS][a-zA-Z]+)\\\\b", text) regmatches(text, rexp) <- lapply(regmatches(text, rexp), col_red) cat(text) wrp <- ansi_strwrap(text, width = 40) cat(wrp, sep = "\n") } \seealso{ Other ANSI string operations: \code{\link{ansi_align}()}, \code{\link{ansi_columns}()}, \code{\link{ansi_nchar}()}, \code{\link{ansi_strsplit}()}, \code{\link{ansi_strtrim}()}, \code{\link{ansi_substring}()}, \code{\link{ansi_substr}()}, \code{\link{ansi_toupper}()}, \code{\link{ansi_trimws}()} } \concept{ANSI string operations} |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |