# string::replace

Returns a string corresponding to the replacement of a given string with another in the specified string.

### Usage

`string string::replace(str, oldValue, newValue)`

### Parameters

Name | Type | Description
--- | --- | ---
str | string | input string
oldValue | string | A String to be replaced.
newValue | string | A String to replace all occurrences of oldValue.

### Return Value

A String equivalent to str but with all instances of oldValue replaced with newValue.

### Exceptions

The function will fail in any of the following circumstances:

- oldValue is an empty string.

### Remarks

This function performs a word (case-sensitive and culture-sensitive) search to find oldValue.

### Examples

-     string::replace('testing string', 'test', 'winn') ==> 'winning string'

-     string::replace('testing string', 'foo', 'winn') ==> 'testing string'

-     string::replace('testing string', 'ing', '') ==> 'test str'

-     string::replace('banana', 'ana', 'ana') ==> 'banana'

### Requirements

Assembly: NAnt.Core (0.92.4543.0)