# 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://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FOoCINyDY8s8Fbf3PIHBe%2Fproperties.png?alt=media)

## 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://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F8t6FauXqjz8cJuq1llU3%2Fdataflow.png?alt=media)

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://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fwd3p8MR5XWYYXbC9B27F%2Foutput.png?alt=media)
