Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Text.RegularExpressions;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace TFYA_lab15
- {
- class Program
- {
- static void Main(string[] args)
- {
- Regex regex = new Regex("часы",RegexOptions.IgnoreCase);
- string target = "таймер";
- string text = "";
- using (StreamReader sr = new StreamReader("D:\\Нужное\\ТФЯ\\lab15\\var5.txt",Encoding.UTF8))
- {
- text = sr.ReadToEnd();
- text = regex.Replace(text, target);
- }
- using (StreamWriter sw = new StreamWriter("D:\\Нужное\\ТФЯ\\lab15\\var5.txt", false, Encoding.UTF8))
- {
- sw.WriteLine(text);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement