CSharp examples for System:String Search
Contains Non Letter Non Digit in String
using System.Text.RegularExpressions; using System.Text; using System.Runtime.InteropServices; using System.Reflection; using System.Linq; using System.IO;//ww w . j a v a2 s .co m using System.ComponentModel; using System.Collections.Generic; using System; public class Main{ public static bool ContainsNonLetterNonDigit(this string s, bool nullCaseResult = false) { bool r = false; if (s == null) { r = nullCaseResult; } else { foreach (char c in s) { if (!Char.IsLetterOrDigit(c)) { r = true; break; } } } return r; } }