Search This Blog

Thursday, January 24, 2013

Regular expression pattern Split method in C#

C# > Text > Regular Expressions > Split

Splits an input string into an array of substrings at the positions defined by a regular expression pattern.

Example:
string path = "some_text_words";
string[] substrings = Regex.Split(path, "_");
foreach (string match in substrings)
{}