Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何删除\n,\t的字符串。
\n
\t
例如"\n\t\t\t\tDay of Week\n\t\t\t"应该被视为"Day of Week"当 cucumber 从表中读取它时。
"\n\t\t\t\tDay of Week\n\t\t\t"
"Day of Week"
得到如下错误:
RuntimeError: Element do not match for entry : Day of Week
测试数据仅作为文本输入,但 cucumber 从应用程序中读取它"\n\t\t\t\tDay of Week\n\t\t\t"并且比较失败。
具体需要做什么?
这是这样的:
p "\n\t\t\t\tDay of Week\n\t\t\t".strip! # >> "Day of Week"