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] |
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
Right-click on the function transformation object and select Preview Output. You can see that the “Danes” has been replaced by “Luke” successfully.