Mega Code Archive

 
Categories / C# / Data Types
 

Does a string have only one word

//The MIT License (MIT) //http://arolibraries.codeplex.com/license using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; namespace AroLibraries.ExtensionMethods.Strings {     public static class StringExt     {         public static bool Ext_IsValidOneWord(this string iString)         {             if (!String.IsNullOrEmpty(iString))             {                 string word = iString.Trim().ToLower();                 if (!String.IsNullOrEmpty(word))                 {                     foreach (char c in word)                     {                         if (char.IsLetter(c) == false)                         {                             return false;                         }                     }                     return true;                 }             }             return false;         }     } }