Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- using System.Text.RegularExpressions;
- class MainClass
- {
- public static void Main(string[] args)
- {
- string pattern = @"[A-Z]";
- string to_delete = @"[^a-z0-9 \f\n\r\t\v]";
- string to_delete_word = @"(\b([a-z0-9]){1,3}\b)";
- string to_delete_space = @"\s{2, }";
- string first_space = @"^\s";
- string str;
- while((str = Console.ReadLine())!= null)
- {
- str = Regex.Replace(str, pattern, m => m.ToString().ToLower());
- str = Regex.Replace(str, to_delete, String.Empty);
- str = Regex.Replace(str, to_delete_word, String.Empty);
- str = Regex.Replace(str, to_delete_space, @"\s");
- Console.WriteLine(Regex.Replace(str, first_space, String.Empty));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement