Skip Navigation
Instance MethodMethod

rawStringLiteral(_:)

Returns a raw multi-line Swift string literal for arbitrary text.

func rawStringLiteral(_ text: String) -> String

Parameters

text

The text to embed.

Return Value

The raw string literal.

Discussion

The number of # delimiters is chosen so that nothing in the text can end the literal early or start an interpolation. The closing delimiter starts in the first column, so the text keeps its indentation.