String ToUpper() and ToLower() Method in C#
ToUpper() – The C# ToUpper() string method used to convert string alphabets values to Uppercase alphabets values.
ToLower() – The C# ToLower() string method used to convert string alphabets values to Lowercase alphabets values.
C# Example of ToUpper() and ToLower()
In above example ToUppler() method converts every string character to uppercase. Here string “Meera Academy” converted to “MEERA ACADEMY”.
On other side in ToLower() method converts every string character to lowercase. As string “Meera Academy” converted to “meera academy”.
C# code for ToUpper() button click:
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = TextBox1.Text.ToUpper();
}
C# code for ToLower() button click :
protected void Button2_Click(object sender, EventArgs e)
{
Label1.Text = TextBox1.Text.ToLower();
}
Subscribe us
If you liked this c#.net post, then please subscribe to our YouTube Channel for more c#.net video tutorials.
We hope that this C#.net tutorial helped you to understand String ToUpper() and ToLower().
Next asp.net tutorial we will learn about C# String Trim() Function.