Ejemplo n.º 1
0
        void OnCalculate(object sender, EventArgs e)
        {
            Count countLib    = new Count();
            int   countSpaces = countLib.CountSpaces(input.Text);
            int   countWords  = countLib.CountWords(input.Text);
            int   a1          = Math.Min(countSpaces, countWords);
            int   an          = Math.Max(countSpaces, countWords);

            result      = countLib.CountSum(a1, an);
            output.Text = $"There are {countWords} words and {countSpaces} spaces in the string.\n" +
                          $"The sum of numbers between {a1} and {an} is {result}";
        }