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_substr.Rd at main · multimeric/cli Expand file tree/ Copy pathansi_substr.RdMore file actions 67 lines (61 loc) · 1.67 KB / Copy pathansi_substr.RdFile metadata and controls67 lines (61 loc) · 1.67 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 59 60 61 62 63 64 65 66 67 % Generated by roxygen2: do not edit by hand % Please edit documentation in R/ansiex.R \name{ansi_substr} \alias{ansi_substr} \title{Substring(s) of an ANSI colored string} \usage{ ansi_substr(x, start, stop) } \arguments{ \item{x}{Character vector, potentially ANSI styled, or a vector to coerced to character.} \item{start}{Starting index or indices, recycled to match the length of \code{x}.} \item{stop}{Ending index or indices, recycled to match the length of \code{x}.} } \value{ Character vector of the same length as \code{x}, containing the requested substrings. ANSI styles are retained. } \description{ This is a color-aware counterpart of \code{\link[base:substr]{base::substr()}}. It works exactly like the original, but keeps the colors in the substrings. The ANSI escape sequences are ignored when calculating the positions within the string. } \examples{ str <- paste( col_red("red"), "default", col_green("green") ) cat(str, "\n") cat(ansi_substr(str, 1, 5), "\n") cat(ansi_substr(str, 1, 15), "\n") cat(ansi_substr(str, 3, 7), "\n") substr(ansi_strip(str), 1, 5) substr(ansi_strip(str), 1, 15) substr(ansi_strip(str), 3, 7) str2 <- paste( "another", col_red("multi-", style_underline("style")), "text" ) cat(str2, "\n") cat(ansi_substr(c(str, str2), c(3,5), c(7, 18)), sep = "\n") substr(ansi_strip(c(str, str2)), c(3,5), c(7, 18)) } \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_strwrap}()}, \code{\link{ansi_substring}()}, \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. |