How to convert uppercase letters to lowercase letters using C#?

PHPz
Release: 2023-09-02 10:45:02
forward
854 people have browsed it

如何使用 C# 将大写字母转换为小写字母?

To convert uppercase letters to lowercase letters, use the ToLower() method in C#.

Assume your string is -

str = "TIM";
Copy after login

To convert the uppercase string above to lowercase, use the ToLower() method -

Console.WriteLine("Converted to LowerCase : {0}", str.ToLower());
Copy after login

The following is the conversion in C# Codes for character case -

Example

using System; using System.Collections.Generic; using System.Text; namespace Demo { class MyApplication { static void Main(string[] args) { string str; str = "TIM"; Console.WriteLine("UpperCase : {0}", str); // convert to lowercase Console.WriteLine("Converted to LowerCase : {0}", str.ToLower()); Console.ReadLine(); } } }
Copy after login

The above is the detailed content of How to convert uppercase letters to lowercase letters using C#?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!