Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- string text = "My name is Adam";
- text = Regex.Replace(text, @"[^s]", "x");
- Console.WriteLine(text);
- Console.ReadKey();
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- string text = "My name is Adam";
- // английские буквы
- text = Regex.Replace(text, @"[a-z]", "x");
- text = Regex.Replace(text, @"[A-Z]", "X");
- // русские буквы
- text = Regex.Replace(text, @"[а-яё]", "x");
- text = Regex.Replace(text, @"[А-ЯЁ]", "X");
- Console.WriteLine(text);
- Console.ReadKey();
- }
- }
- string text = "My name is Adam. Моё имя Адам.";
- text = Regex.Replace(text, @"p{Ll}", "x");
- text = Regex.Replace(text, @"p{Lu}", "X");
- Console.WriteLine(text);
Add Comment
Please, Sign In to add comment