Strings

Refer to the following table:

Expanding string

“ “
“Value”
$greeting = “Hello”; “$greeting World” # Expands variable

Expanding here-string

@”

“@
$one = ‘One’
@”
Must be opened on its own line.
This string will expand variables like $var.
Can contain other quotes like “ and ‘.
Must be closed on its own line with no preceding white space.
“@

Non-expanding string

‘ ‘
‘Value’
‘$greeting World’ # Does not expand variable

Non-expanding here-string

@’

‘@
@’
Must be opened on its own line.
This string will not expand variables like $var.
Can contain other quotes like “ and ‘.
Must be closed on its own line with no preceding white space.
‘@

Quotes in strings

“ `” “

“ ““ “

‘ `’ ‘

‘ ‘‘ ‘
“Double-quotes may be escaped with tick like `”.”
“Or double-quotes may be escaped with another quote ““.”
‘Single-quotes may be escaped with tick like `’.’
‘Or single-quotes may be escaped with another quote like ‘‘.’
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset