StringLineGroup Struct

A group of StringLine.

public struct StringLineGroup : IEnumerable

See also

Implements

Nested types

NameDescription
StringLineGroup.EnumeratorEnumerates the lines of a StringLineGroup.
StringLineGroup.IteratorThe iterator used to iterate other the lines.
StringLineGroup.LineOffsetThe position of a line in the slice that StringLineGroup.ToSlice returns.

Constructors

NameDescription
StringLineGroup(int)Initializes a new instance of the StringLineGroup class.
StringLineGroup(string)Initializes a new instance of the StringLineGroup class.

StringLineGroup overloads

StringLineGroup(int)

StringLineGroup.cs

Initializes a new instance of the StringLineGroup class.

public StringLineGroup(int capacity)
Parameters
capacity int

StringLineGroup(string)

StringLineGroup.cs

Initializes a new instance of the StringLineGroup class.

public StringLineGroup(string text)
Parameters
text string
The text.
Exceptions
ArgumentNullException

Properties

NameDescription
CountGets the number of lines.
LinesGets the lines.

Gets the number of lines.

public readonly int Count { get; }

Property value

int

Gets the lines.

public readonly StringLine[] Lines { get; }

Property value

StringLine[]

Methods

NameDescription
Add(StringLine)Adds the specified line to this instance.
Add(StringSlice)Adds the specified slice to this instance.
Clear()Clears this instance.
GetEnumerator()Gets enumerator.
RemoveAt(int)Removes the line at the specified index.
System.Collections.IEnumerable.GetEnumerator()
ToCharIterator()Converts this instance into a ICharIterator.
ToSlice(List<StringLineGroup.LineOffset>?)Converts the lines to a single StringSlice by concatenating the lines.
ToString()Performs the to string operation.
Trim()Trims each lines of the specified StringLineGroup.

Add overloads

Add(StringLine)

StringLineGroup.cs

Adds the specified line to this instance.

public void Add(ref StringLine line)
Parameters
line StringLine
The line.

Add(StringSlice)

StringLineGroup.cs

Adds the specified slice to this instance.

public void Add(StringSlice slice)
Parameters
slice StringSlice
The slice.

Clears this instance.

public void Clear()

GetEnumerator()

StringLineGroup.cs

Gets enumerator.

public StringLineGroup.Enumerator GetEnumerator()

RemoveAt(int)

StringLineGroup.cs

Removes the line at the specified index.

public void RemoveAt(int index)

Parameters

index int
The index.

System.Collections.IEnumerable.GetEnumerator()

StringLineGroup.cs
IEnumerator IEnumerable.GetEnumerator()

No documentation is available.

ToCharIterator()

StringLineGroup.cs

Converts this instance into a ICharIterator.

public readonly StringLineGroup.Iterator ToCharIterator()

ToSlice(List<StringLineGroup.LineOffset>?)

StringLineGroup.cs

Converts the lines to a single StringSlice by concatenating the lines.

public readonly StringSlice ToSlice(List<StringLineGroup.LineOffset>? lineOffsets = null)

Parameters

lineOffsets List<StringLineGroup.LineOffset>?
The position of the `\n` line offsets from the beginning of the returned slice.

Returns

StringSlice A single slice concatenating the lines of this instance

Performs the to string operation.

public override readonly string ToString()

Returns

string

Trims each lines of the specified StringLineGroup.

public void Trim()