language: C# (mono-2.8)
date: 927 days 8 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System;
using System.Text.RegularExpressions;
 
public class Test
{
        public static void Main()
        {
                string notCool = "not cool . bro // M ";
                string notCool2 = "not CoOl123 bro mm ";
                
                Console.WriteLine ( Check_short (notCool) );
                Console.WriteLine ( Check_short (notCool2) );
        }
        private static string Check_short(string input)
        {    
 
input = Regex.Replace(input, "(M )", "peter", RegexOptions.IgnoreCase);
input = Regex.Replace(input, "(Mm )", "mark", RegexOptions.IgnoreCase);
 
 
return input;
        }
}