How to remove space at beginning and end of a string in Dart

Viewed 1148

using Dart How to remove space at the beginning and end of a string?

 String name =" Well Wisher ";

or this

 String name =" Well Wisher";

or from this

String name ="Well Wisher ";
1 Answers

Thanks @https://stackoverflow.com/users/5882307/omi-shah the .trim() function is used to remove white space from the front and end of a string

String name =" Well Wisher ";

name.trim();  // "Well Wisher"
Related