- using System;
- using System.Net.NetworkInformation;
- using System.Net;
- using System.Net.Sockets;
- using System.Text.RegularExpressions;
- namespace Example
- {
- class Program
- {
- static void Main()
- {
- string var = "1ab23cd4ghg4g3g2j34g";
- string str = Regex.Replace(var, @"\d", "");
- string num = Regex.Replace(var, @"\D", "");
- int total = var.Trim().Length;
- Console.WriteLine("Main String :: " + var);
- Console.WriteLine("Total number of char :: "+total);
- Console.WriteLine("Letters :: " + str);
- Console.WriteLine("Number :: " + num.ToString());
- Console.ReadLine();
- }
- }
- }
In this article i am giving a example based on c#,which have a single string with alphanumeric .split char and number value and count using c#.
