TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

<< Back to VBNET

VB.NET ToTitleCase Function

Use the ToTitleCase Function from System.Globalization. Make each word title case.
ToTitleCase uppercases each word in a String. Custom-developed algorithms may be superior. But the ToTitleCase function from System.Globalization is more convenient. It is effective in most VB.NET program contexts.TextInfo

Info: This example shows the ToTitleCase method on TextInfo from System.Globalization.

Example. Please notice how this program imports the System.Globalization namespace. In Main, it uses the TextInfo instance on CultureInfo.CurrentCulture and calls ToTitleCase. The output has each letter following a space or period uppercased.
VB.NET program that uses ToTitleCase Imports System.Globalization Module Module1 Sub Main() Dim value As String = "dot net Codex vb.net" Dim title As String = CultureInfo.CurrentCulture. TextInfo.ToTitleCase(value) Console.WriteLine(title) End Sub End Module Output The Dev Codes Vb.Net
Unfortunately, ToTitleCase does not contain extensive logic. It cannot handle special cases. For example, the acronym "VB.NET" is not uppercased correctly. To solve this problem, you can call Replace on every special case you require.Replace
Summary. There are many ways to do the same basic tasks in the .NET Framework. ToTitleCase is built into the .NET Framework for you, but it cannot cover every possible case you might require.

Therefore: It is sometimes necessary to design custom algorithms to uppercase words in a string.

Uppercase First
© TheDeveloperBlog.com
The Dev Codes

Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf