Replace
AutomatR.DefaultActivities.GenericValue.Replace
The "Replace" activity in AutomatR, categorized under String, substitutes strings in a specified input string that match a given regular expression pattern with a designated replacement string. This activity is useful when you need to perform string manipulation by replacing occurrences of a specific substring with another value.
Properties
Name | Description |
---|---|
Input | |
Old Value | Specify the old value to be replaced. String variables containing the substring to be replaced. |
Input String | The string to be replaced. String variables containing the input string. |
New Value | Specify the replacement string. String variables containing the new substring to replace the old value. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variable or argument containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Replace" activity. Useful for handling synchronization issues. Integer variables containing the delay duration. Example: If the wait time is 1000 milliseconds or 1 sec, i.e., 1. |
Output | |
Result | It stores the result in a string variable, which can be used for other subsequent activities. String variables to store the modified string after replacement. |
How to use:
- Drag and drop the "Replace" activity onto the workflow.
- Configure the properties by specifying the input string, old value, and new value.
- Optionally, configure the delay based on your requirements.
- Execute the workflow to replace occurrences of the old value with the new value in the input string.
Example: Consider an example where the "Replace" activity is used to replace occurrences of a word in a sentence:
Replace:
Input String: "The quick brown fox jumps over the lazy dog."
Old Value: "quick"
New Value: "swift"
Result: modifiedSentence
In this example, the activity replaces the occurrence of the word "quick" with "swift" in the input string. The modified sentence is stored in the string variable "modifiedSentence" for further use in the workflow.