CSharp examples for System.Text.RegularExpressions:Match String
Removes the punctuations by regex.
using System.Text.RegularExpressions; using System.Text; using System.Globalization; using System.Diagnostics.CodeAnalysis; using System;//from w w w . j ava 2 s. c o m public class Main{ /// <summary> /// Removes the punctuations. /// </summary> /// <returns>The clean string.</returns> /// <param name="source">The source string.</param> public static string RemovePunctuations(this string source) { return Regex.Replace(source, @"[!\(\)\[\]{}\:;\.,?'""]*", String.Empty); } }