Strip Spaces - CSharp System

CSharp examples for System:String Strip

Description

Strip Spaces

Demo Code


using System.Text.RegularExpressions;
using System.Text;
using System.Net;
using System.Linq;
using System.Drawing;
using System;//from  w  w w.  j  ava  2 s . com

public class Main{
        public static string StripSpaces(this string str) {
			return string.IsNullOrEmpty(str) ? str : Regex.Replace(str, @"\s+", "", RegexOptions.Multiline);
		}
}

Related Tutorials