Code For Count the String ?

Sabarimahesh
Posted by Sabarimahesh under C# category on | Points: 40 | Views : 1210
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{

int cnt = 0;
string str = "Sabarimahesh";
foreach (char chh in str)
{
if (char.IsLetter(chh))
{
cnt++;
}
}
Console.WriteLine(cnt.ToString());
Console.ReadLine();
}
}
}


Output

12

Comments or Responses

Login to post response