Advertisement
Gillito

Untitled

Jun 10th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace ConsoleApplication15
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             using (StreamReader sr = new StreamReader("D:\\New.txt"))
  15.             {
  16.                 string str = sr.ReadLine();
  17.                 string strResult = null;
  18.  
  19.                 foreach (char a in str)
  20.                 {
  21.                     if (char.IsDigit(a))
  22.                         strResult += a;
  23.                 }
  24.             }
  25.  
  26.             using (StreamWriter sw = new StreamWriter("D:\\New.txt"))
  27.             {
  28.                 sw.WriteLine();
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement