-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
38 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,8 @@ xref:xlat/index.adoc[dynamic expansions]. As with | |
xref:type/string/single.adoc[single-quoted strings], text within | ||
double quotes can include spaces. | ||
|
||
For normally quoted strings, the quotation character can be placed inside of | ||
the string by escaping it with a backslash. | ||
|
||
For triple quoted strings, the quotation character does not need to be | ||
escaped. However, if the string does contain an escaped quotation | ||
character, the quotation character is unescaped, as with normally | ||
quoted strings. | ||
The quotation character can be placed inside of the string by escaping | ||
it with a backslash. | ||
|
||
The main difference between the single and double quoted strings is | ||
that the double quoted strings can be dynamically expanded. The syntax | ||
|
@@ -141,13 +136,8 @@ string is being used. | |
`"this has embedded\ncharacters"` + | ||
`"attribute\tvalue\nusername\t%{User-Name}\nreply-message\t%{reply.Reply-Message}"` | ||
`"The result of 'SELECT * FROM foo WHERE 1' is: %sql(SELECT * FROM foo WHERE 1)"` | ||
`"""this string has a "double quoted" string in the middle of it"""` | ||
|
||
// Licenced under CC-by-NC 4.0. | ||
// Copyright (C) 2019 Arran Cudbard-Bell <[email protected]> | ||
// Copyright (C) 2019 The FreeRADIUS project. | ||
// Copyright (C) 2021 Network RADIUS SAS. | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
doc/antora/modules/reference/pages/type/string/triple.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
= Triple Quoted Strings | ||
|
||
.Syntax | ||
`"""string"""` | ||
`'''string'''` | ||
|
||
Triple-quoted strings are similar to their single-quoted or | ||
double-quoted counterparts. The main difference is that for triple | ||
quoted strings, the quotation character does not need to be escaped. | ||
However, if the string does contain an escaped quotation character, | ||
the quotation character is unescaped, as with normally quoted strings. | ||
|
||
Triple-quoted strings make it easier to create strings with embedded | ||
quotes in them, because the quotes do not need to be escaped. | ||
|
||
.Examples | ||
|
||
`"""word"""` + | ||
`"a string"' + | ||
`"""foo"bar"!"""` + | ||
`"""this is a long string"""` + | ||
`"""this has embedded\ncharacters"""` + | ||
`"""this string has a "double quoted" string in the middle of it"""` | ||
`'''This is a string with 'embedded' quotes'''` | ||
|
||
// Licenced under CC-by-NC 4.0. | ||
// Copyright (C) 2025 Network RADIUS SAS. | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters