using System;
public class StringSplitForeach
{
public static void Main()
{
string s = "Oh, I hadn't thought of that";
char[] separators = new char[] {' ', ','};
foreach (string sub in s.Split(separators))
{
Console.WriteLine("Word: {0}", sub);
}
}
}