using System.Collections.Generic;
using System.Threading.Tasks;
public static void Main()
string val = "In this example, we declare a second list of numbers - sort of a black-list of numbers which we don't want to be included! In the Where() method, we use the Contains() method on the black-list, to decide whether a number can be included in the final list of numbers or not. And of course, it works for more complex objects than numbers and strings, and it's still very easy to use. Just have a look at this example, where we use objects with user information instead of numbers, and use the Where() method to get a list of users with names starting with the letter 'J', at the age of 39 or less:";
List<string> specialChars = new List<string>() {
",", ":", ";", "!", "(", ")", "."
specialChars.ForEach(str => val = val.Replace(str, ""));
string[] words = val.Split(' ');
words = words.Where(w => !string.IsNullOrEmpty(w) && !w.Equals("-")).ToArray();
Console.WriteLine("Result: " + string.Join(",", words));
Console.WriteLine("Word count: " + words.Count());