C#

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Wednesday, 10 December 2014

Count Number of recurring character in a string

using System;
using System.Linq;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string x = "aaaaanurAg";
            var z = x.ToUpper().ToCharArray().Where(y=>y=='A').Count();
            Console.WriteLine(z);
            Console.ReadLine();
        }
    }

}

Output: 


No comments:

Post a Comment