Advertisement
Gillito

Untitled

Jun 5th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication33
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             StringTool objString = new StringTool();
  14.  
  15.             Console.WriteLine("Введите строку ");
  16.             objString.processedString = Console.ReadLine();
  17.             Console.WriteLine(objString.LettersClean(Console.ReadLine()));
  18.            
  19.         }
  20.     }
  21.  
  22.     class StringTool
  23.     {
  24.         public string processedString;
  25.  
  26.         public string LettersClean(string somestring)
  27.         {
  28.             string resultString = null;
  29.             foreach (char a in somestring)
  30.                 if (!char.IsLetter(a))
  31.                     resultString += a;
  32.             return resultString;
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement