Introduction
This code snippet shows how to find & replace UpperCase Letters With LowerCase or vice versa in string using C#
C#
- using System;
- public class Program
- {
- public static void Main()
- {
- char result;
- string name = "rAJEEShmENOTH";
- char[] charArry = name.ToCharArray();
- foreach (var data in charArry)
- {
- if (Char.IsLower(data))
- {
- result = Char.ToUpper(data);
- }
- else
- {
- result = Char.ToLower(data);
- }
- Console.Write(result);
- }
- }
- }
Demo : https://dotnetfiddle.net/mhROO5
