stripAnsi function

String stripAnsi(
  1. String text
)

Strip ANSI escape sequences from text.

Implementation

String stripAnsi(String text) {
  return text.replaceAll(
    RegExp(r'\x1B\[[0-9;]*[a-zA-Z]|\x1B\][^\x07]*\x07'),
    '',
  );
}