> 文章列表 > WindownsPowershell中的单引号和双引号

WindownsPowershell中的单引号和双引号

WindownsPowershell中的单引号和双引号

WindownsPowershell中的单引号双引号

目录标题

  • WindownsPowershell中的单引号和双引号
      • 单引号对中,可以直接写双引号
      • 双引号对中,可以直接写单引号
      • 反引号 可以在 双引号对中表示转义
          • 双引号对中, 可以用 反引号双引号 表示一个双引号
          • 双引号对中, 可以用 反引号单引号 表示一个单引号

单引号对中,可以直接写双引号

PS D:\\> ' " '"
PS D:\\> ' "" '""
PS D:\\> ' """ '"""
PS D:\\> ' "hello" '"hello"
PS D:\\>

WindownsPowershell中的单引号和双引号

双引号对中,可以直接写单引号

PS D:\\> " ' "'
PS D:\\> " '' "''
PS D:\\> " ''' "'''
PS D:\\> " 'world' "'world'

WindownsPowershell中的单引号和双引号

反引号 可以在 双引号对中表示转义

反引号不能在单引号对中表示转义
反引号不能直接表示转义

双引号对中, 可以用 反引号双引号 表示一个双引号
PS D:\\> " `" ""
PS D:\\> " `"`" """
PS D:\\> " `"`"`" """"
PS D:\\> " `"hello`" ""hello"

WindownsPowershell中的单引号和双引号

双引号对中, 可以用 反引号单引号 表示一个单引号
PS D:\\> " `' "'
PS D:\\> " `'`' "''
PS D:\\> " `'`'`' "'''
PS D:\\> " `'hello`' "'hello'

WindownsPowershell中的单引号和双引号