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".
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
Challenge
EasyWrite 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
}
}