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