Skip to main content

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

NameDescription
Input
Old ValueSpecify the old value to be replaced. String variables containing the substring to be replaced.
Input StringThe string to be replaced. String variables containing the input string.
New ValueSpecify the replacement string. String variables containing the new substring to replace the old value.
Misc
Display NameProvides 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
DelaySpecifies 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
ResultIt 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:

  1. Drag and drop the "Replace" activity onto the workflow.
  2. Configure the properties by specifying the input string, old value, and new value.
  3. Optionally, configure the delay based on your requirements.
  4. 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.