'How to split a line with \n in a list robotframework

How to split a line with \n in a list robotframework

Example: ["abc\n def\n xyz\n]



Solution 1:[1]

Use below snippet to split by \n in a string. Split String can be used to split based on delimiter. I hope this you're expecting.

*** Settings ***
Library    String

*** Test Cases ***
Test_Split
    ${Line} =     Set Variable    abc\n def\n xyz\n
    @{Splitted_Values} =    Split String    ${Line}    \n
    FOR    ${value}    IN    @{Splitted_Values}
        Log    {value}
    END

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Manish Kumar