473,394 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

ToTitleCase() doesn't work for upper case strings

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

Aug 3 '06 #1
2 7445
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?
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Tim_Mac" <ma********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
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

Aug 3 '06 #2
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

Aug 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Vaughan | last post by:
I was expecting the class sets.Set to act like an unordered list with no two members equal. But, while the following code prints True, the assertion fails. from sets import Set _base = str...
4
by: Dwight | last post by:
Hi all, How do you capitalize the first letter of each word in a field. I can format the field to UPPER case the last name of a person, but I can't UPPER case just the first letter of each name....
149
by: Christopher Benson-Manica | last post by:
(Followups set to comp.std.c. Apologies if the crosspost is unwelcome.) strchr() is to strrchr() as strstr() is to strrstr(), but strrstr() isn't part of the standard. Why not? --...
2
by: Brad Smith | last post by:
I'm trying to clean up strings in a web form before I plug the fields into a database. Lots of folks like to leave caps lock key on and yell their form entries. I can figure out how to change...
17
by: bill | last post by:
I have the following cod ein my base page: Private tInfo As TextInfo = New CultureInfo("en-US", False).TextInfo Protected Function TitleIt(ByVal input As String) As String Return...
3
by: bob | last post by:
In vb6 you could say s = Format(s, "!") to force text to upper case in the format function. I've searched the vb.net help system and can't find any help on formatting text. There's plenty of help...
14
by: fniles | last post by:
In VB.NET 2005 can I check if a letter in a string is upper case or lower case ? For example: I have the following 2 lines: NQ,Z2003,11/11/2003,1416.5,1420,1402,1411.5...
4
by: titan nyquist | last post by:
Why does ToTitleCase not work if the case is already in upper case? I have to make my string lowercase, first, before I pass to to ToTitleCase to have it work. Titan
19
by: bowlderyu | last post by:
Hello, all. If a struct contains a character strings, there are two methods to define the struct, one by character array, another by character pointer. E.g, //Program for struct includeing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.