6
Answers

Count words, and skip the spaces.

Freddy Abreu

Freddy Abreu

11y
1.2k
1
Hi, this something very basic I know it, but how can I skip the spaces in this basic program please.

            string Palabras = string.Empty;
            //int ContEspacios;            
            
                
            
            Console.WriteLine("Escribe una palabra:");
            Palabras = Console.ReadLine();
            
            foreach (var X in Palabras.Length.ToString())
            {
            
            
                Console.WriteLine("Cuantas palabras tiene {0}:",X);
            }
            
            
            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
        }
    }
}
Answers (6)