예제 #1
0
        static void Main()
        {
            string target = "My hip-hop is better than your hip-hop";
            string substr = "hip-hop";

            SubstringCounterClient client = new SubstringCounterClient();

            int count = client.GetSubstringCount(target, substr);

            Console.WriteLine(count);
        }
예제 #2
0
        static void Main()
        {
            var client = new SubstringCounterClient();

            string s1 = "day";
            string s2 = "monday, tuesday, wednesday... firday";
            int count = client.GetOccurrences(s1, s2);

            Console.WriteLine("str1 = \"{0}\"", s1);
            Console.WriteLine("str2 = \"{0}\"", s2);
            Console.WriteLine("str2 contains str1 {0} times.", count);
        }