condenseWhiteSpace method

String condenseWhiteSpace(
  1. String str
)

Cleans up provided string by removing extra whitespace. 通过删除额外的空格来清理提供的字符串

Implementation

String condenseWhiteSpace(String str) {
  return str.replaceAll(RegExp(r"\s+"), " ").trim();
}