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.
我有这段文字:
Ch d\`Arnb
现在,如果存在,我想\从字符串中删除所有内容。我尝试了很多解决方案,其中之一:{{ item|replace({'\/': ''}) }}。但没有成功。接下来我可以尝试什么?
\
{{ item|replace({'\/': ''}) }}
替换参数有错误。您目前正在尝试删除/字符。尝试这个:
/
{% set item = 'Foo\Bar' %} {{ item|replace({'\\': ''}) }}
输出:FooBar
FooBar