Sentence

References
public sealed class Sentence
Utility class for formatting adjectives and subclauses into a single sentence.

Constructors

Sentence

#
public Sentence()
Create a new formatter.

Sentence

#
public Sentence(string separator, string terminator)
Create a new formatter.
separator (string)Separator string. This would typically be a comma+space pair.
terminator (string)Final character, typically a period. May be null for phrases which are not intended to be terminated.

Properties

Capitalise

#
public bool Capitalise { get; set; }
Gets or sets wether to automatically capitalise the first letter of each new sentence.

Count

#
public int Count { get; }
Gets the number of fragments in this sentence, i.e. the total number of adjectives and subclauses.

Separator

#
public string Separator { get; set; }
Gets or sets the separator string between subclauses, and between consecutive comma-adjectives.

Terminator

#
public string Terminator { get; set; }
Gets or sets the terminating string.

Methods

Adjective

#
public void Adjective(string adjective)
Append an adjective which qualifies the next subclause. Adjectives are separated from each other, but not from the subclause they modify.
adjective (string)Adjective to add.

AndAdjective

#
public void AndAdjective(string adjective)
Append an adjective which is joined to the preceding fragment using the word "and". The word is omitted if this is the first fragment.
adjective (string)Adjective to add.

Clause

#
public void Clause(string clause)
Append a subclause to this formatter.
clause (string)Clause to add.

OrAdjective

#
public void OrAdjective(string adjective)
Append an adjective which is joined to the preceding fragment using the word "or". The word is omitted if this is the first fragment.
adjective (string)Adjective to add.

ToString

#
public override string ToString()
Format all fragments into a sentence.
Formatted sentence.
Object.ToString

Convertors

OperationResultDescription
implicitSentencestringAuto convert a formatter to a string.