SHARE
TWEET

15

a guest Dec 8th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.IO;
  3. using System.Text.RegularExpressions;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8.  
  9. namespace TFYA_lab15
  10. {
  11.     class Program
  12.     {
  13.         static void Main(string[] args)
  14.         {
  15.             Regex regex = new Regex("часы",RegexOptions.IgnoreCase);
  16.             string target = "таймер";
  17.             string text = "";
  18.             using (StreamReader sr = new StreamReader("D:\\Нужное\\ТФЯ\\lab15\\var5.txt",Encoding.UTF8))
  19.             {
  20.                 text = sr.ReadToEnd();
  21.                 text = regex.Replace(text, target);
  22.             }
  23.             using (StreamWriter sw = new StreamWriter("D:\\Нужное\\ТФЯ\\lab15\\var5.txt", false, Encoding.UTF8))
  24.             {
  25.                 sw.WriteLine(text);
  26.             }
  27.         }
  28.     }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top