TomlStringSyntax Class

A string, in any of its four forms: basic, literal, and the multi-line form of each.

public sealed class TomlStringSyntax : TomlValueSyntax
Inheritance
TomlValueSyntax TomlStringSyntax

Properties

NameDescription
IsLiteralGets a value indicating whether the string is written between single quotes, and has no escape sequences.
IsMultiLineGets a value indicating whether the string is written between three quotes, and may span lines.
StringToken
ValueGets the text of the string, with its quotes removed and its escape sequences resolved.

Gets a value indicating whether the string is written between single quotes, and has no escape sequences.

public bool IsLiteral { get; }

Property value

bool

Gets a value indicating whether the string is written between three quotes, and may span lines.

public bool IsMultiLine { get; }

Property value

bool

public SyntaxToken StringToken { get; }

Property value

SyntaxToken

No documentation is available.

Gets the text of the string, with its quotes removed and its escape sequences resolved.

public string Value { get; }

Property value

string

Remarks

Line breaks in a multi-line string are line feeds, whichever line break the text uses.

When the string is in error, which SyntaxNode.ContainsDiagnostics tells, this is a best guess: an escape sequence that is not valid is left out or kept in part, and a string without its closing quotes runs to the end of its line, or of the text for a multi-line one. Check for diagnostics before relying on it.

Methods

NameDescription
Accept(TomlSyntaxVisitor)
Accept<TResult>(TomlSyntaxVisitor<TResult>)
Update(SyntaxToken)Returns this value with a different token, or itself when nothing changed.
WithStringToken(SyntaxToken)
WithValue(string)Returns this string with a new value, written as a basic string and escaped as TOML requires.

Accept overloads

Accept(TomlSyntaxVisitor)

TomlStringSyntax.cs
public override void Accept(TomlSyntaxVisitor visitor)
Parameters
visitor TomlSyntaxVisitor

No documentation is available.

Accept<TResult>(TomlSyntaxVisitor<TResult>)

TomlStringSyntax.cs
public override TResult? Accept<TResult>(TomlSyntaxVisitor<TResult> visitor)
Type parameters
TResult
Parameters
visitor TomlSyntaxVisitor<TResult>
Returns

TResult?

No documentation is available.

Update(SyntaxToken)

TomlStringSyntax.cs

Returns this value with a different token, or itself when nothing changed.

public TomlStringSyntax Update(SyntaxToken stringToken)

Parameters

stringToken SyntaxToken

Returns

TomlStringSyntax

WithStringToken(SyntaxToken)

TomlStringSyntax.cs
public TomlStringSyntax WithStringToken(SyntaxToken stringToken)

Parameters

stringToken SyntaxToken

Returns

TomlStringSyntax

No documentation is available.

WithValue(string)

TomlStringSyntax.cs

Returns this string with a new value, written as a basic string and escaped as TOML requires.

public TomlStringSyntax WithValue(string value)

Parameters

value string

Returns

TomlStringSyntax

Exceptions

ArgumentNullException
value is null.