Library reference

Convert text to lowercase

Give these short labels the same letter case. All four inputs use plain English letters and digits.

ToLowerInvariant

Simple example

Change the case of two letters.

Start'AB'
Resultab
Program.cs
using System;

Console.WriteLine("AB".ToLowerInvariant());
Output
ab
Advertisements

Everyday examples

Make the bus label match the route board.

Start'BUS'
Resultbus
Program.cs
using System;

Console.WriteLine("BUS".ToLowerInvariant());
Output
bus

Give an art shelf the same lettering as the other shelves.

Start'ART'
Resultart
Program.cs
using System;

Console.WriteLine("ART".ToLowerInvariant());
Output
art

Normalize the letters in a ticket code and keep its digits.

Start'B12'
Resultb12
Program.cs
using System;

Console.WriteLine("B12".ToLowerInvariant());
Output
b12
Run the example
Terminal
dotnet new console --output Lesson
cp Program.cs Lesson/Program.cs
dotnet run --project Lesson
Official documentation