//Remove double-spaces and reprocess the value public List <int> VerifyJobTitle() { var errors = new List <int>(); if (JobTitle == null) { return(errors); } JobTitle = JobTitle.Trim().Replace(HidroConstants.DOUBLE_SPACE, HidroConstants.WHITE_SPACE); if (string.IsNullOrEmpty(JobTitle) || string.IsNullOrWhiteSpace(JobTitle)) { JobTitle = null; return(errors); } JobTitle = HelperProvider.CapitalizeFirstLetterOfEachWord(JobTitle); var lenTest = new Regex(@".{1,30}"); if (!lenTest.IsMatch(JobTitle)) { errors.Add(6); } var jTest = new Regex(@"^[A-Za-z,\-.'() ]*$"); if (!jTest.IsMatch(JobTitle)) { errors.Add(7); } return(errors); }