Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #259 Split on several separators

Build the list parts consisting of substrings of the input string s, separated by any of the characters ',' (comma), '-' (dash), '_' (underscore).

using System.Text.RegularExpressions;
var parts = Regex.Split(s, "[,_-]");

New implementation...
< >
programming-idioms.org