HighTechTalks DotNet Forums  

System.Globalisation.CultureInfo.TextInfo.ToTitleC ase()

Dotnet Internationalization microsoft.public.dotnet.internationalization


Discuss System.Globalisation.CultureInfo.TextInfo.ToTitleC ase() in the Dotnet Internationalization forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Sharat Koya
 
Posts: n/a

Default System.Globalisation.CultureInfo.TextInfo.ToTitleC ase() - 05-11-2006 , 05:21 AM






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);

}

}



Reply With Quote
  #2  
Old   
Michael \(michka\) Kaplan [MS]
 
Posts: n/a

Default Re: System.Globalisation.CultureInfo.TextInfo.ToTitleC ase() - 05-11-2006 , 09:17 AM






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

Quote:
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);

}

}




Reply With Quote
  #3  
Old   
Sharat Koya
 
Posts: n/a

Default Re: System.Globalisation.CultureInfo.TextInfo.ToTitleC ase() - 05-11-2006 , 11:03 AM



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...
Quote:
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);

}

}






Reply With Quote
  #4  
Old   
Sharat Koya
 
Posts: n/a

Default Re: System.Globalisation.CultureInfo.TextInfo.ToTitleC ase() - 05-11-2006 , 02:09 PM



I have given up and found this...

http://www.heikniemi.net/hc/archives/000145.html




"Sharat Koya" <SHARAT.KOYA (AT) ADDENBROOKES (DOT) NHS.UK> wrote

Quote:
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);

}

}








Reply With Quote
  #5  
Old   
Michael \(michka\) Kaplan [MS]
 
Posts: n/a

Default Re: System.Globalisation.CultureInfo.TextInfo.ToTitleC ase() - 05-13-2006 , 06:43 PM



VB has had primitive support for "proper case" since the early days of VB$,
possdibly earlier. It is not the same as title case, which is following the
Unicode definition.


--
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

Quote:
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);

}

}








Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.