Insert New Line to Text
Verb: appendLineToText
Inserts a new line at the end of a text.
Syntax
appendLineToText --text(String) --value(String) (String)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--text | Text | Required | Text | Text where the new line is inserted. |
--value | New line | Required | Text | Text that should be inserted in the new line. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Text | Text | Returns the text with the new line inserted. |
Example
Example 1: The command inserts a new line to an existing text.
defVar --name text --type String --value IBM
defVar --name textNewLine --type String --value AUTOMATION
defVar --name newText --type String
appendLineToText --text "${text}" --value "${textNewLine}" newText=value
logMessage --message "${newText}" --type "Info"
//The result obtained in $ {newText} is:
//IBM
//AUTOMATION
Example 2: The command inserts a time into an existing date.
defVar --name text --type Date --value "2019-08-12"
defVar --name newText --type String
appendLineToText --text "${text}" --value "9:00 AM" newText=value
logMessage --message "${newText}" --type "Info"
//The result obtained in $ {newText} is:
//2019-08-12
//9 :00 AM
Remarks
In the Text and New line parameters, it is possible to enter several variable types, however it is always returned as a Text.