Home Notices Documents Classes Download Others Rice
Classes  >  regex  >  Split(string)
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

ClassNameDescription
stringsourceA string which is searched.

Return value

ClassDescription
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.

Links for reference

Copyright © Rice All rights reserved.