CSharp examples for System:String Contain
Contains Illegal Characters
using System.Text.RegularExpressions; using System.Text; using System.Globalization; using System.Collections.Generic; using System;//from w ww .j a v a 2 s. com public class Main{ public static bool ContainsIllegalCharacters(string searchText) { if (searchText.Contains("/") || searchText.Contains("\\") || searchText.Contains(":") || searchText.Contains("?") || searchText.Contains("\"") || searchText.Contains("<") || searchText.Contains(">") || searchText.Contains("|") || searchText.Contains("*")) { return true; } return false; } }