--- title: "replace" description: "Finds all occurrences of a substring inside of a source string, and replaces them with the replacement string." --- # replace > Finds all occurrences of a substring inside of a source string, and replaces them with the replacement string. **This function is used by Ignition's Expression language.** ## Description Finds all occurrences of a substring inside of a source string, and replaces them with the replacement string. The first argument is the source, the second is the search string, and the third is the replacement. ## Syntax `replace(string, substring, replacementString)` ### Parameters | Type | Parameter | Description | |---|---|---| | String | `string` | The starting string. | | String | `substring` | The string to search for. | | String | `replacementString` | The string to replace any instances of the substring with. | ### Results **String** - The starting string with all instances of the substring replaced by the replacementString. ## Examples ```python title="Code Snippet" replace("XYZ", "Y", "and") //returns "XandZ" ``` ```python title="Code Snippet" replace("bob and mary went to bob's house", "bob", "judith") //returns "judith and mary went to judith's house" ```