Ramco Ramco

Ramco Ramco

  • 443
  • 3.4k
  • 526.4k

Common Functions

Aug 16 2024 3:19 AM

Hi

 In below code i have created some functions. I want them to be in one place. What should i do

public static bool IsAlphaNumericWithUnderscore(string input)
{
    return Regex.IsMatch(input, "^[a-zA-Z0-9_]+$");
}
public static bool IsAllLetters(string s)
{
    foreach (char c in s)
    {
        if (!Char.IsLetter(c))
            return false;
    }
    return true;
}

Thanks


Answers (8)