【问题标题】:Is it possible to write a " in a string, if yes how?是否可以在字符串中写一个“,如果是的话怎么写?
【发布时间】:2019-02-05 01:19:18
【问题描述】:

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

需要标记为字符吗?

【问题讨论】:

标签: string powershell escaping


【解决方案1】:

您需要将其加倍,将其放在单引号内或使用 ` 转义

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

【讨论】:

    猜你喜欢
    • 2018-07-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-07
    相关资源
    最近更新 更多