RosettaCodeData/Task/Quoting-constructs/Agena/quoting-constructs.agena
2026-04-30 12:34:36 -04:00

18 lines
870 B
Text

# Agena supports quoted strings, these can be used in expressions to represent literal
# string values. A quoted string starts and ends with matching quote characters.
# There are three possible quote characters: ', " and `
# e.g.:
local s1 := "an initial value";
print( 's1 has ' & s1 & `...` );
# C-style escapes are supported within strings quoted with ' or "
# Within a string quoted by ', embedded " characters need not be escaped
# Within a string quoted by ", embedded ' characters need not be escaped
# e.g.:
print( "a\tb\tc" );
print( '"double-quoted" text contained in a \' quoted string' );
print( "'single-quoted' text contained in a \" quoted string" );
# Within ` quoted strings, C-style escapes are not processed, except \q which reprtesents `
# e.g.:
print( `Within \q...\q, these are not escape sequences: \t\\\"\n \012, \0x5f but this one is: \q` );