Replace matches Version 8 (Java)
Description
The action changes the specified text in the original text to the set one.
Action icon
Parameters
Input parameters
Parameter | Description |
---|---|
Text | The original text for processing. |
Replace | The text in the original text to be replaced if present. |
To | New value for the text to be replaced. |
Output parameters
The output is a string variable containing the processed text.
Settings
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Text | Text to make action on | Robin.String | Yes | |
Replace | The string to be replaced | Robin.String | Yes | |
To | The string to replace all occurrences of Replace | Robin.String | Yes | |
Results | ||||
Result | A string variable containing the processed text. | Robin.String |
Special conditions of use
None.
Example of use
Task
There is a variable "Input text" with the text value: "Olya Ivanova, Olya Smirnova, Olya Petrova". Replace the first match for the name Olya with Masha. Display the changed text in the dialog box.
Solution
Use the "Replace matches" and "Get message" actions.
Implementation
- Create a variable "Text variable" to which the "Replace matches" action result will be written.
- Move the "Replace matches" action to the workspace and set its parameters.
- Move the "Get message" action to the workspace and set its parameters.
- Start the robot by clicking "Start" in the top panel.
Result
The dialogue window with the replaced text was displayed.
Обзор
Инструменты контента