EVOLUTION-MANAGER
Edit File: ansi_trimws.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Remove leading and/or trailing whitespace from an ANSI string</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for ansi_trimws {cli}"><tr><td>ansi_trimws {cli}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Remove leading and/or trailing whitespace from an ANSI string</h2> <h3>Description</h3> <p>This function is similar to <code><a href="../../base/html/trimws.html">base::trimws()</a></code> but works on ANSI strings, and keeps color and other styling. </p> <h3>Usage</h3> <pre> ansi_trimws(x, which = c("both", "left", "right")) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>ANSI string vector.</p> </td></tr> <tr valign="top"><td><code>which</code></td> <td> <p>Whether to remove leading or trailing whitespace or both.</p> </td></tr> </table> <h3>Value</h3> <p>ANSI string, with the whitespace removed. </p> <h3>See Also</h3> <p>Other ANSI string operations: <code><a href="ansi_align.html">ansi_align</a>()</code>, <code><a href="ansi_columns.html">ansi_columns</a>()</code>, <code><a href="ansi_nchar.html">ansi_nchar</a>()</code>, <code><a href="ansi_strsplit.html">ansi_strsplit</a>()</code>, <code><a href="ansi_strtrim.html">ansi_strtrim</a>()</code>, <code><a href="ansi_strwrap.html">ansi_strwrap</a>()</code>, <code><a href="ansi_substring.html">ansi_substring</a>()</code>, <code><a href="ansi_substr.html">ansi_substr</a>()</code>, <code><a href="ansi_toupper.html">ansi_toupper</a>()</code> </p> <h3>Examples</h3> <pre> trimws(paste0(" ", col_red("I am red"), " ")) ansi_trimws(paste0(" ", col_red("I am red"), " ")) trimws(col_red(" I am red ")) ansi_trimws(col_red(" I am red ")) </pre> <hr /><div style="text-align: center;">[Package <em>cli</em> version 3.4.1 <a href="00Index.html">Index</a>]</div> </body></html>