stripAnsi function

String stripAnsi(
  1. String s
)

Removes ANSI escape sequences from s (colours, bold, cursor moves, etc.).

Implementation

String stripAnsi(String s) => s.replaceAll(RegExp(r'\x1B(?:[@-Z\\-_]|\[[0-9;]*[A-Za-z])'), '');