Split with regular expression, string extension method


/ Published in: C#
Save to your folder(s)

This is an extension method for splitting strings with a regular expression.


Copy this code and paste it in your HTML
  1. public static class StringExtensions
  2. {
  3. public static string[] Split(this String str, System.Text.RegularExpressions.Regex separator)
  4. {
  5. return separator.Split(str);
  6. }
  7. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.