onepub-dev / dcli

An extensive library and tooling for building console/cli applications and scripts using the Dart programming language.
245 stars 28 forks source link

How to read none color ascii outputs from other applications? #165

Closed Hu-Wentao closed 3 years ago

Hu-Wentao commented 3 years ago

I use forEach method to call other app, it very useful, Thank you for your great work! but, other app outputs some colorful String, I can not treating them with regex, Can you provide some features or other suggestions?

bsutton commented 3 years ago

Can you provide some more details as I'm not certain of what you are asking?

If the app is outputting ansi escape characters you can strip them using:

var strippedString = Ansi.strip(stringWithAnsiEscapes);
Hu-Wentao commented 3 years ago

Ohhh, thank you very much, It worked ! You can consider writing this method as an example in redme, it is too useful !