gpt4 book ai didi

powershell - 我可以在 PowerShell 'string' 中使用单引号吗?

转载 作者:行者123 更新时间:2023-12-02 22:18:10 25 4
gpt4 key购买 nike

我想在字符串中包含撇号。是否可以不使用双引号?

'This is a quote. Can`'t I just include a single quote in it?'
'This is another quote that doesn\'t work'

最佳答案

'Escape a single quote '' using a double single quote'

请参阅 the quoting rules 的帮助.

您可以通过键入以下内容在 powershell 命令行中查看帮助:

Get-Help about_Quoting_Rules

它解释了反引号在单引号字符串中按字面解释。

Because the contents of single-quoted strings are interpreted literally, you cannot use the backtick character to force a literal character interpretation in a single-quoted string.

关于powershell - 我可以在 PowerShell 'string' 中使用单引号吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11231410/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com