Converts the specified string to title case (except for words that are entirely in uppercase, which are considered to be acronyms).
Assembly: mscorlib (in mscorlib.dll)
Generally, title casing converts the first character of a word to uppercase and the rest of the characters to lowercase. However, this method does not currently provide proper casing to convert a word that is entirely uppercase, such as an acronym. The following table shows the way the method renders several strings.
war and peace
War and Peace
War And Peace
Per anhalter durch die Galaxis
Per Anhalter durch die Galaxis
Per Anhalter Durch Die Galaxis
les naufragés d'ythaq
Les Naufragés d'Ythaq
Les Naufragés D'ythaq
As illustrated above, the method provides an arbitrary casing behavior which is not necessarily linguistically correct. A linguistically correct solution would require additional rules, and the current algorithm is somewhat simpler and faster. We reserve the right to make this API slower in the future.
The current implementation of the method yields an output string that is the same length as the input string. However, this behavior is not guaranteed and could change in a future implementation.
The following example changes the casing of a string based on the English (United States) culture, with the culture name en-US.
The following example passes each string in an array to the method. The strings include proper title strings as well as acronyms. The strings are converted to title case by using the conventions of the en-US culture.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.