How to remove both leading and trailing spaces from string?

 Posted by vishalneeraj-24503 on 12/12/2013 | Category: ASP.NET Interview questions | Views: 1828 | Points: 40

Use Trim() method of Dot Net.we can remove any start and end space of string value.

For Example:-

string str = " Vishal ";
str = str.Trim();

Output will be:- "Vishal"

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response