我尝试了多种方法将包含转义序列字符的变量转换为空字符串。如何用空格替换和转义序列字符?
${stg} Set Variable \r\n
Replace String ${stg} \r\n ${EMPTY}
Log ${stg}
Should Not Be Equal ${stg} \r\n
在第4行,$ {stg} =='\ r \ n'。我如何将其留空?
答案 0 :(得分:2)
你非常接近,替换字符串的文档给你答案:
A modified version of the string is returned and the original
string is not altered.
Examples:
| ${str} = | Replace String | Hello, world! | world | tellus |
| Should Be Equal | ${str} | Hello, tellus! | | |
在您的情况下,将第2行的返回分配到$ {stg}:
${stg} Replace String ${stg} \r\n ${EMPTY}