stripAnsi function

String stripAnsi(
  1. String text
)

Strip ANSI escape codes from a text

Use ansiRegex to match ANSI escape codes

Implementation

String stripAnsi(String text) {
  return text.replaceAll(ansiRegex(), '');
}