Menu
Coddy logo textTech

Uppercase & Lowercase

Lesson 6 of 14 in Coddy's Strings and Arrays in C# course.

Let's play with cases!

Use ToUpper() to convert a string to uppercase letters,

string example = "Hello World";
string upper = example.ToUpper();

In the above example, upper will hold the string "HELLO WORLD".

Use ToLower() to convert a string to lowercase letters,

string example = "HelLO WOrld";
string lower = example.ToLower();

In the above example, lower will hold the string "hello world".

quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

challenge icon

Challenge

Easy

Write a function named capitalizeStart that gets a string as an argument and returns the same string, but the first character should be capitalized (in uppercase).

Try it yourself

using System;

class CapitalizeStart {
    public static string capitalizeStart(string s) {
        // Write code here
    }
}

All lessons in Strings and Arrays in C#