是否可以写一个“字符串,如果是的话怎么样?

问题描述 投票:-3回答:1

我需要将"写入字符串,因为脚本需要格式化,但我不知道该怎么做。

是否需要将其标记为角色?

string powershell escaping
1个回答
3
投票

你需要加倍它,把它放在一个单引号内或用`转义它

echo "This will output a double quote """
echo '"This will also be put in double quotes"'
echo "`"This is another way to quote`""

有关更多字符串引用的基础知识,请参阅official documentation

© www.soinside.com 2019 - 2024. All rights reserved.