CSharp examples for System:String Match
Determines whether a string matches the given pattern.
using System.Text.RegularExpressions; using System.IO;//from w w w . ja va 2s . co m using System.Collections.Generic; public class Main{ /// <summary> /// Determines whether a string matches the given pattern. /// </summary> /// <param name="Input">The string to check.</param> /// <param name="Pattern">The regular expression.</param> /// <returns>True if the string matches the pattern or false if not.</returns> public static bool IsMatch(this string Input, string Pattern) { Regex r = new Regex(Pattern); return r.IsMatch(Input); } }