regex class : Split(string) method
Description
Gets a list of substrings which is splitted with a string that matches the regular expression in the argument.
Syntax
regexInstance.Split(string source)
Arguments
Class | Name | Description |
string | source | A string which is searched. |
Return value
Class | Description |
list{string} | A list of substrings which is splitted with a string that matches the regular expression. |
Sample code
1: | regex pattern = new regex("a+"); |
2: | list{string result} = pattern.Split("aaabbbaaccc"); |
Notes
It's a wrapper of the System.Text.RegularExpressions.Regex.Split(String) method.