contains
Whether text contains an ANSI escape character (ESC, U+001B).
A cheap check for output that is styled, for instance to decide whether to strip it with
strip before writing it to a file.
Import
Section titled “Import”Cargo feature ansi (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
text | &str | The text to check. |
Returns
Section titled “Returns”bool — true when the text has an escape character.
