oneLineLabel function

String oneLineLabel(
  1. String s
)

s with every run of whitespace (newlines included) collapsed to one space, for labels shown on a single output line.

Implementation

String oneLineLabel(String s) => s.replaceAll(RegExp(r'\s+'), ' ').trim();