# ReplaceFirst (String str, String lookFor, String replaceWith)

| Name                     | *ReplaceFirst*                                                                   |
| ------------------------ | -------------------------------------------------------------------------------- |
| Applicable To (DataType) | String                                                                           |
| Purpose                  | To replace the first occurrence of the string with your desired value.           |
| Description              | Replaces first occurrence of lookFor with replaceWith.                           |
| Return Type              | String                                                                           |
| Syntax                   | str \[System.String] – the string in which the characters will be replaced.      |
|                          | lookFor \[System.String] – the string that will be searched.                     |
|                          | replaceWith \[System.String] – the string that will replace the searched screen. |
|                          | isCaseSensitive \[System.Boolean]                                                |

![properties](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/aGeaWbdHDDScRSp88u55/properties.png)

## Example

In this example, we are passing the required parameters to the data fields under the *Input* node inside the function transformation object.

Where,

*str* = April Danes

*lookFor* = Danes

*replaceWith* = Luke

*isCaseSensitive* = False

![dataflow](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/59NI23X9LZX354mQ82CM/dataflow.png)

Right-click on the function transformation object and select *Preview Output*. You can see that the “Danes” has been replaced by “Luke” successfully.

![output](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/ucNl52FEy3SKmAv3tjVT/output.png)
