Is there any inbuilt way in C# to split a text into an array of words and delimiters?
What I want is:
text = "word1 + word2 - word3";
string[] words = text.Split(new char[] { '+', '-'});
//Need list '+', '-' here?
Any ideas? Obviously I can just process the text by hand… 🙂
Use Regex.split() with capturing parentheses http://msdn.microsoft.com/en-us/library/byy2946e.aspx