String.ToLower Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Returns a copy of this string converted to lowercase, using the casing rules of the current culture.
Assembly: mscorlib (in mscorlib.dll)
The following code example converts several mixed case strings to lowercase.
using System; public class Example { public static void Demo(System.Windows.Controls.TextBlock outputBlock) { string[] info = { "Name", "Title", "Age", "Location", "Gender" }; outputBlock.Text += "The initial values in the array are:" + "\n"; foreach (string s in info) outputBlock.Text += s + "\n"; outputBlock.Text += String.Format("{0}The lowercase of these values is:", "\n") + "\n"; foreach (string s in info) outputBlock.Text += s.ToLower() + "\n"; outputBlock.Text += String.Format("{0}The uppercase of these values is:", "\n") + "\n"; foreach (string s in info) outputBlock.Text += s.ToUpper() + "\n"; } }
Show:
Note: