- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is String Title case in C#?
The ToTitleCase method is used to capitalize the first letter in a word. Title case itself means to capitalize the first letter of each major word.
Let us see an example to get the title case −
Example
using System; using System.Globalization; class Demo { static void Main() { string str = "jack sparrow"; string res = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(str); Console.WriteLine(res); } }
Output
Jack Sparrow
Above, we have set the input string to the ToTitleCase() method. The CultureInfo.TextInfo property is used to provide the culture-specific casing information for strings −
CultureInfo.CurrentCulture.TextInfo.ToTitleCase(str);
Advertisements