NAnt
Help
Filter Reference
<replacestring> |
v0.85-nightly-2005-11-09 |
[This is preliminary documentation and subject to change.]
Replaces all occurrences of a given string in the original input with user-supplied replacement string.
This filter replaces all occurrences of a given string in the original input stream with a user-supplied replacement string. By default string comparisons are case sensitive but this can be changed by setting the optional ignorecase attribute to true.
To use this filter specify the string to be replaced with the from attribute and the string to replace it with using the to attribute.
Filters are intended to be used as a element of a <filterchain>.
| Attribute | Type | Description | Required |
|---|---|---|---|
| from | string | The string to be replaced. | True |
| ignorecase | bool | Determines if case will be ignored. The default is false. | False |
| to | string | The new value for the replaced string. Am empty string is permissible. | False |
| if | bool | If true then the filter will be used; otherwise, skipped. The default is true. | False |
| unless | bool | Opposite of if. If false then the filter will be executed; otherwise, skipped. The default is false. |
False |
Replace all occurrences of "3.14" with "PI".
<replacestring from="3.14" to="PI" />
Replace all occurrences of "string", "String", etc. with "System.String".
<replacestring from="String" to="System.String" ignorecase="true" />