![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
has anyone got ToTitleCase to work in .net 2.0? I have tried the following console app and it still returns capitals. Thanks class Program { static void Main(string[] args) { string hello = "HELLOWORLD"; Console.WriteLine(TitleCase(hello)); Console.ReadLine(); } private static string TitleCase(string s) { System.Globalization.CultureInfo textInfo = System.Threading.Thread.CurrentThread.CurrentCultu re; return textInfo.TextInfo.ToTitleCase(s); } } |
#3
| |||
| |||
|
|
Title Case does not mean "Proper Case" in the sense of capitalizing the first letter -- it is a Unicode property of each character -- which in this string is the same as the uppercase form. -- MichKa [Microsoft] NLS Collation/Locale/Keyboard Technical Lead Globalization Infrastructure, Fonts, and Tools Blog: http://blogs.msdn.com/michkap This posting is provided "AS IS" with no warranties, and confers no rights. "Sharat Koya" <SHARAT.KOYA (AT) ADDENBROOKES (DOT) NHS.UK> wrote in message news:eGCp7wNdGHA.1436 (AT) TK2MSFTNGP05 (DOT) phx.gbl... has anyone got ToTitleCase to work in .net 2.0? I have tried the following console app and it still returns capitals. Thanks class Program { static void Main(string[] args) { string hello = "HELLOWORLD"; Console.WriteLine(TitleCase(hello)); Console.ReadLine(); } private static string TitleCase(string s) { System.Globalization.CultureInfo textInfo = System.Threading.Thread.CurrentThread.CurrentCultu re; return textInfo.TextInfo.ToTitleCase(s); } } |
#4
| |||
| |||
|
|
Ah I see, thanks for your response. What is the best way of performing Proper Case? Is there a built in function or is it a case of a series of string functions? Thanks Sharat "Michael (michka) Kaplan [MS]" <michkap (AT) microsoft (DOT) online.com> wrote in message news:eeg5C1PdGHA.1260 (AT) TK2MSFTNGP05 (DOT) phx.gbl... Title Case does not mean "Proper Case" in the sense of capitalizing the first letter -- it is a Unicode property of each character -- which in this string is the same as the uppercase form. -- MichKa [Microsoft] NLS Collation/Locale/Keyboard Technical Lead Globalization Infrastructure, Fonts, and Tools Blog: http://blogs.msdn.com/michkap This posting is provided "AS IS" with no warranties, and confers no rights. "Sharat Koya" <SHARAT.KOYA (AT) ADDENBROOKES (DOT) NHS.UK> wrote in message news:eGCp7wNdGHA.1436 (AT) TK2MSFTNGP05 (DOT) phx.gbl... has anyone got ToTitleCase to work in .net 2.0? I have tried the following console app and it still returns capitals. Thanks class Program { static void Main(string[] args) { string hello = "HELLOWORLD"; Console.WriteLine(TitleCase(hello)); Console.ReadLine(); } private static string TitleCase(string s) { System.Globalization.CultureInfo textInfo = System.Threading.Thread.CurrentThread.CurrentCultu re; return textInfo.TextInfo.ToTitleCase(s); } } |
#5
| |||
| |||
|
| http://support.microsoft.com/default...b;en-us;312897 this article also states Proper Case ? "Michael (michka) Kaplan [MS]" <michkap (AT) microsoft (DOT) online.com> wrote in message news:eeg5C1PdGHA.1260 (AT) TK2MSFTNGP05 (DOT) phx.gbl... Title Case does not mean "Proper Case" in the sense of capitalizing the first letter -- it is a Unicode property of each character -- which in this string is the same as the uppercase form. -- MichKa [Microsoft] NLS Collation/Locale/Keyboard Technical Lead Globalization Infrastructure, Fonts, and Tools Blog: http://blogs.msdn.com/michkap This posting is provided "AS IS" with no warranties, and confers no rights. "Sharat Koya" <SHARAT.KOYA (AT) ADDENBROOKES (DOT) NHS.UK> wrote in message news:eGCp7wNdGHA.1436 (AT) TK2MSFTNGP05 (DOT) phx.gbl... has anyone got ToTitleCase to work in .net 2.0? I have tried the following console app and it still returns capitals. Thanks class Program { static void Main(string[] args) { string hello = "HELLOWORLD"; Console.WriteLine(TitleCase(hello)); Console.ReadLine(); } private static string TitleCase(string s) { System.Globalization.CultureInfo textInfo = System.Threading.Thread.CurrentThread.CurrentCultu re; return textInfo.TextInfo.ToTitleCase(s); } } |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |