trim method

String trim(
  1. String str
)

Trim spaces from given string.

Implementation

String trim(String str) {
  return str.replaceAll(RegExp(r'^\s+|\s+$'), '');
}