- 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
How to convert Lower case to Upper Case using C#?
To convert Lower case to Upper case, use the ToUpper() method in C#.
Let’s say your string is −
str = "david";
To convert the above lowercase string in uppercase, use the ToUpper() method −
Console.WriteLine("Converted to UpperCase : {0}", str.ToUpper());
The following is the code in C# to convert character case −
Example
using System; using System.Collections.Generic; using System.Text; namespace Demo { class MyApplication { static void Main(string[] args) { string str; str = "david"; Console.WriteLine("LowerCase : {0}", str); // convert to uppercase Console.WriteLine("Converted to UpperCase : {0}", str.ToUpper()); Console.ReadLine(); } } }
Advertisements