我想在我的字符串中包含一个撇号。是否可以不使用双引号?
'This is a quote. Can`'t I just include a single quote in it?'
'This is another quote that doesn\'t work'
我想在我的字符串中包含一个撇号。是否可以不使用双引号?
'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'
请参阅引用规则的帮助。
您可以通过键入以下命令在 powershell 命令行中查看帮助:
Get-Help about_Quoting_Rules
它解释了反引号在单引号字符串中按字面意思解释。
因为单引号字符串的内容是按字面解释的,所以不能使用反引号字符来强制在单引号字符串中进行字面字符解释。