Javeed Ishaq
Javeed Ishaq

Reputation: 7105

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

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 ";

Upvotes: 9

Views: 5027

Answers (1)

Javeed Ishaq
Javeed Ishaq

Reputation: 7105

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"

Upvotes: 14

Related Questions