Exemplo n.º 1
0
        public string[] SplitSentence()
        {
            char[]    delimiterChars = { ' ', ',', '.', ':', '!', '\t' };
            string [] wordArray      = InputSentence.Split(delimiterChars);

            return(wordArray);
        }
Exemplo n.º 2
0
        public int WordNumber()
        {
            int totalWords = 0;

            string[] splitSentence = InputSentence.Split(signs);
            for (int i = 0; i < splitSentence.Length; i++)
            {
                if (splitSentence[i] == InputWord)
                {
                    totalWords++;
                }
            }
            return(totalWords);
        }