Ken Barrett

Ken Barrett

  • NA
  • 123
  • 0

Name validation (this should be an easy one)

Feb 13 2009 1:11 PM
I'm relatively new to C# (came from the PERL world).

I am looking at a string the user is going to enter in a text box, and want to determine whether or not it could be a name.

A name doesn't have any numbers in it, and the entire string should contain at least 2 spaces and at most 3 spaces (first middle last).

Since this is a common problem, I am supposing that there is a common solution.  In the PERL world I would do this with a regular expression, but here I am stuck with generating some cumbersome code.

My question is, what is the common solution to this common problem?

TIA

Answers (3)