Using trim() to eliminate white space in Dart and it doesn\'t work. What am I doing wrong or is there an alternative?
trim()
String product = \"COC
Try this
String product = "COCA COLA"; print('Product id is: ${product.replaceAll(new RegExp(r"\s+\b|\b\s"), "")}');
Update:
String name = '4 ever 1 k g @@ @'; print(name.replaceAll(new RegExp(r"\s+"), ""));