Wednesday, 21 May 2014

Remove white space from string using Regex Asp.net MVC

Remove white space from string using Regex Asp.net MVC


Introduction

Here we learn how remove white space from string object using Regex.

Description

Regex in .net is used to do transaction on RegularExpressions .We can compare RegularExpressions also we can format string by using regex RegularExpressions. 

Solution

Step 1 :  Create your Asp.net MVC 4 application first using Visual Studio 2012 or Above .

Step 2 :  Now access your regex RegularExpressions in any method.

string result = System.Text.RegularExpressions.Regex.Replace("string value", @"\s", " ");



No comments:

Post a Comment

Thank you for your interest .