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, " ", "");
Response.Write(new_value);
Output would be:-
WelcometoDotNetFunda.Com