Single-quoted strings
Multi-word strings can be surrounded by single quotation
marks, 'like this'
.
For example:
if $autoupdate { notice('autoupdate parameter has been deprecated and replaced with package_ensure. Set this to latest for the same behavior as autoupdate => true.') }
Line breaks within the string are interpreted as literal line breaks.
Single-quoted strings can’t interpolate values.
Escape sequences
The following escape sequences are available in single-quoted strings:
Sequence | Result |
---|---|
\\ | Single backslash |
\' | Literal single quotation mark |
To include a literal double backslash use a quadruple backslash.
To include a backslash at the very end of a single-quoted string, use a double backslash
instead of a single backslash. For example: path =>
'C:\Program Files(x86)\\'
A good habit is to always use two backslashes where you want the result to
be one backslash. For example,
path => 'C:\\Program
Files(x86)\\'