Разделить строку на цифры и буквы - C#
Формулировка задачи:
как разделить цифры от букв в Си шарп?
Решение задачи: «Разделить строку на цифры и буквы»
textual
Листинг программы
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication15
{
class Program
{
static void Main(string[] args)
{
string myString="1856hhfyret6640ger";
foreach(char ch in myString)
{
if (char.IsDigit(ch))
Console.WriteLine("Digit: {0}",ch);
if (char.IsLetter(ch))
Console.WriteLine("Letter: {0}", ch);
}
Console.ReadLine();
}
}
}