×

C# Tutorial

Basics of .Net

C# Basics

C# Fundamentals

C# Operators

C# Loops

C# Type Conversions

C# Exception Handling

C# String Class

C# Arrays

C# List

C# Stack

C# Queue

C# Collections

C# Character Class

C# Class and Object

C# Namespaces

C# Delegates

C# Constructors

C# Inheritance

C# Operator Overloading

C# Structures

C# File Handling

C# Convert.ToInt32()

C# Int32 (int) Struct

C# DateTime Class

C# Uri Class

C# Database Connectivity

C# Windows

C# Other Topics

C# Q & A

C# Programs

C# Find O/P

C# program to convert a string from lowercase to uppercase

Here, we are going to learn how to convert a string from lowercase to uppercase in C#?
Submitted by Nidhi, on October 10, 2020

Problem statement

Here we read a string from the keyboard and then convert the string from lowercase to uppercase.

C# program to convert a string from lowercase to uppercase

The source code to convert a string from lowercase to uppercase in a given string is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.

//C# program to convert a string from 
//lowercase to uppercase.

using System;

class Demo
{
    public static void Main()
    {
        string text;
        Console.WriteLine("Enter a string:");
        
        text = Console.ReadLine();
        text = text.ToUpper();

        Console.WriteLine("String in Uppercase : "+text);
    }
}

Output

Enter a string:
www.includehelp.com
String in Uppercase : WWW.INCLUDEHELP.COM
Press any key to continue . . .

Explanation

Here, we created a Demo class that contains the Main() method. The Main() method is the entry point of the program. Here we read a string from the keyboard.

text = text.ToUpper();

Using the ToUpper() method, we converted the string from lowercase to uppercase and then printed the modified string on the console screen.

C# Basic Programs »

Advertisement
Advertisement

Comments and Discussions!

Load comments ↻


Advertisement
Advertisement
Advertisement

Copyright © 2025 www.includehelp.com. All rights reserved.