String Remove Extra White Space In Dart

String remove extra white space :

  • String remove extra white spaces at the end of or start of the string.

1) trim() – All white spaces remove of the string.
2) trimLeft() – Remove the white spaces start of string.
3) trimRight() – Remove the white spaces end of string.

String Remove Extra White Space In Dart
void main() {
  String message = "      Hello       ";
  print("***" + message.trimRight() + "***");
  print("***" + message.trimLeft() + "***");
  print("***" + message.trim() + "***");

/* output
* Hello*
***Hello ***

The flutter tutorial  is a website that bring you the latest and amazing resources of code. All the languages codes are included in this website. The languages like flutter, android, java,kotlin etc.with the help of this languages any user can develop the beautiful application

For more information about Flutter. visit