Problem:
Toggling Cases

Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.

Input

A string is given in a line.

Output

Print the converted string in a line. Note that you do not need to convert any characters other than alphabetical letters.

Constraints

The length of the input string < 1200

Sample Input

fAIR, LATER, OCCASIONALLY CLOUDY.

Sample Output

Fair, later, occasionally cloudy.

Solution in C# (judge verdict: Accepted)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace CsProgramSpace
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] inp = Console.ReadLine().Split(',').Select(_ => _).ToArray();
            string res = "";
            for(int i = 1;i<inp.Length;i++)
            {
                inp[i] = inp[i].Remove(0, 1);
            }
            for (int i = 0; i < inp.Length; i++)
            {
                char[] temp = inp[i].ToCharArray();
                res += ", ";
                for (int j = 0; j<temp.Length;j++)
                {
                    if (!Regex.IsMatch(temp[j].ToString(), "[A-Z||a-z]"))
                    {
                        res += temp[j];
                        continue;
                    }
                    if(char.IsUpper(temp[j]))
                    {
                        temp[j] = Char.ToLower(temp[j]);
                    }
                    else if(char.IsLower(temp[j]))
                    {
                        temp[j] = Char.ToUpper(temp[j]);
                    }
                    res += temp[j];
                }
            }
            res = res.Remove(0, 2);
            Console.WriteLine(res);
        }
    }
}