ToTitleCase() doesn't work for upper case strings

  • Thread starter Thread starter Tim_Mac
  • Start date Start date
T

Tim_Mac

hi,
i'm referring to System.Globalization.TextInfo.ToTitleCase(string s)
and it works fine if you pass in an all lower or mixed case string.
however i am trying to make amends for data entry staff who like to
leave Caps Lock on all the time, so all the input is in upper case.
ToTitleCase("CORK") returns "CORK" instead of "Cork".

any ideas why? i can obviously sent all the strings ToLower before
calling ToTitleCase but that seems like a hack.

i read the unicode technical report that the case-mapping is based on
and based on the specification, it should convert the first letter to a
capital letter (if it has a mapping) and all subsequent letters in the
word to lower case.

thanks for any help
tim
 
Hi,

If you read the docs it clearly says that in an uppercase word it makes no
changes. basically cause he does not know if it's a name, what would happen
with MSDN , OS, XML and the rest of others acronism used?
 
hi ignacio
you are right, i just checked the 2.0 documentation and they make it
clear about the upper case exception. however the 1.1 docs i was
originally reading make no mention of it.
thanks for pointing this out.
tim
 
Back
Top