Logic to on Title Case words with no vowels

This commit is contained in:
John Jenko 2014-01-16 22:17:22 +00:00
parent e9cce23bf1
commit 4701474068

View File

@ -930,6 +930,9 @@ namespace VEPROMS.CSLA.Library
{ {
if (Regex.IsMatch(m.Value, @"^[A-Za-z]+\.?$")) if (Regex.IsMatch(m.Value, @"^[A-Za-z]+\.?$"))
{ {
// don't title case "words" that have no vowles
if (Regex.IsMatch(m.Value.ToUpper(), @"^[BCDFGHJKLMNPQRSTVWXZ]+\.?$"))
return m.Value;
string part1 = m.Value.Substring(0, 1); string part1 = m.Value.Substring(0, 1);
string part2 = m.Value.Substring(1); string part2 = m.Value.Substring(1);
return part1.ToUpper() + part2.ToLower(); return part1.ToUpper() + part2.ToLower();