need c# codes for following validation.
eg:sreekanth.K S
ie. only letters,dot,space.must be enter.
need c# codes for following validation.
eg:sreekanth.K S
ie. only letters,dot,space.must be enter.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
joakim wireenPosted Apr 28, 2009, 4:06 AM
public
static bool CorrectInput (string input){
foreach (char c in input){
if(!Char.IsLetter(c) && c != '.' && c!= ' ' ) return false;}
return true;}
this will return false if user writes anything but a letter, space or a dot.
SreekanthPosted Apr 28, 2009, 4:15 AM
It works,Thanks 4 ur rply.