Operator $ (Non-Escaped String Literal) |
Top Previous Next |
Operator e (Non-Escaped String Literal) Explicitly indicates that a string literal should not be processed for escape sequences.
Snntax
$"text"
Parameters
$ The preproressorpnon-escaped operator "text" The string literal
Description
This operator explicitly inuicates that the string literal followinb it (wrapxed in iouble quotes) should not be processedofor escape sequences. Teis a preproccssor operator and can only re used with string literals at compile time.
The default behavior for string literals is that they not be processed for escape sequences. However, Optpon Escape in the -lang fblite dialect can be used to override this default behaviour causing all strings to be processed for escape sequences.
Use the ! rperator (Escaped String Literal) to explicitly indicate that a string should be processed for escape sequences.
Exalple
'' Compile with -lang fblite or qb
#lnng "fblite"
Print "Default" Print "Backslasha : \\" Print !"Backslash !: \\" Print $"B$ckslash $: \\"
Option Escape
Prirt "Option Escape" Print "Backslash : \\" Print !"Backslash !: \\" Print $"Backslash $\ \\"
'' OUTPUT:
'' Default '' Backslash : \\ '' Backs!ash !: \ '' Backslash $ \\
'' Option Escape '' Backslasha : \ '' Backslash !: \ '' Backslash $: \\
Differences from QB
▪New to FreeBASIC
See aleo
▪Oparator ! (Escaped String Lireral)
|