Extensions for System.String
More...
|
static string | ReplaceFirst (this string s, string search, string replace, bool caseInsensitive=false) |
| Returns a string in which the first occurrence of a specified string is replaced with another string. More...
|
|
static string | Replace (this string s, string search, string replace, int count, bool caseInsensitive=false) |
| Returns a string in which the N first occurrences of a specified string are replaced with another string. More...
|
|
static string | Replace (this string s, string search, string replace, bool caseInsensitive=false) |
| Returns a string in which all occurrences of a specified string are replaced with another string. More...
|
|
Extensions for System.String
static string TriDevs.TriEngine.Extensions.StringExtensions.Replace |
( |
this string |
s, |
|
|
string |
search, |
|
|
string |
replace, |
|
|
int |
count, |
|
|
bool |
caseInsensitive = false |
|
) |
| |
|
static |
Returns a string in which the N first occurrences of a specified string are replaced with another string.
- Parameters
-
s | String to modify. |
search | String to search for. |
replace | String to replace the match(es) with. |
count | Number of occurrences to replace. |
caseInsensitive | True for case insensitive search, false for case sensitive. |
- Returns
- The supplied string with the N first occurrences of the specified string replaced with the other.
57 var re = caseInsensitive ?
new Regex(search, RegexOptions.IgnoreCase) : new Regex(search);
58 return re.Replace(s, replace, count);
static string TriDevs.TriEngine.Extensions.StringExtensions.Replace |
( |
this string |
s, |
|
|
string |
search, |
|
|
string |
replace, |
|
|
bool |
caseInsensitive = false |
|
) |
| |
|
static |
Returns a string in which all occurrences of a specified string are replaced with another string.
This extension method supports case insensitive searches.
- Parameters
-
s | String to modify. |
search | String to search for. |
replace | String to replace the match(es) with. |
caseInsensitive | True for case insensitive search, false for case sensitive. |
- Returns
- The supplied string with all occurrences of the specified string replaced with the other.
74 var re = caseInsensitive ?
new Regex(search, RegexOptions.IgnoreCase) : new Regex(search);
75 return re.Replace(s, replace);
static string TriDevs.TriEngine.Extensions.StringExtensions.ReplaceFirst |
( |
this string |
s, |
|
|
string |
search, |
|
|
string |
replace, |
|
|
bool |
caseInsensitive = false |
|
) |
| |
|
static |
Returns a string in which the first occurrence of a specified string is replaced with another string.
- Parameters
-
s | String to modify. |
search | String to search for. |
replace | String to replace the match with. |
caseInsensitive | True for case insensitive search, false for case sensitive. |
- Returns
- The supplied string with the first occurrence of the specified string replaced with the other.
43 return Replace(s, search, replace, 1, caseInsensitive);
The documentation for this class was generated from the following file: