regex class : Delete(string) method
Description
Gets a new string that deleted all strings that match a regular expression pattern in the argument.
Syntax
regexInstance.Delete(string source)
Arguments
Class | Name | Description |
string | source | A string which is searched. |
Return value
Class | Description |
string | A new string that deleted all strings that match a regular expression pattern. |
Sample code
1: | regex pattern = new regex("a+"); |
2: | string result = pattern.Delete("aaabbbaaccc"); // result is "bbbccc". |
Notes
It's a wrapper of the System.Text.RegularExpressions.Regex.Replace(String,String) method.