using System;
using System.Text.RegularExpressions;
namespace ConsoleApplication_C_Sharp
{
class Program
{
static void Main(string[] args)
{
string s = "c# java, vb.net ! c++ $ python%$";
string[] arr = SplitWords(s);
foreach (string word in arr)
{
Console.WriteLine(word);
}
}
static string[] SplitWords(string s)
{
return Regex.Split(s, @"\W+"); // separate non-word
}
}
}
/*
run:
c
java
vb
net
c
python
*/