using System.Text.RegularExpressions;
public static string CheckString(string text)
{
Regex oRegex = new Regex(@"[<;/>]+", RegexOptions.IgnoreCase);
Match oMatch = oRegex.Match(text);
oRegex = null;
if (oMatch.Success)
return "Please do not input any HTML tag";
else
return "";
}Put any character that you want to check inside the "[]".
No comments:
Post a Comment