Removing any Blank Spaces from any given String.

Posted by vishalneeraj-24503 under ASP.NET category on | Points: 40 | Views : 403
First,Import Namespace as System.Text.RegularExpressions,Here we will use Regular Expression' Replace Method which takes 3 parameters as
First param - Input value
Second param - Pattern
Third param - Replacement value

and is used to Remove Blank Spaces from any String as:-
Suppose we have a string called Welcome to Dot Net Funda . Com,then refer below code as:-
string old_value = "Welcome to Dot Net Funda . Com";
string new_value = Regex.Replace(old_value, " ", "");
Output would be:-

Comments or Responses

Login to post response