Skip to content

Instantly share code, notes, and snippets.

@asavchuk
Last active December 3, 2019 19:15
Show Gist options
  • Save asavchuk/5a7c7507a35361bd82dd07af497d5a13 to your computer and use it in GitHub Desktop.
Save asavchuk/5a7c7507a35361bd82dd07af497d5a13 to your computer and use it in GitHub Desktop.
void main() {
String _myText = 'Netflix.com (Amste rdam)';
print(_clean(_myText));
}
_clean(String s) {
return s.replaceAll(RegExp(r'\(.*\)'), '')
.replaceAll(RegExp(' +'), ' ').trim();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment