Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ToString()

override string System.Text.SegmentStringBuilder.ToString ( )
inline

Definition at line 55 of file SegmentStringBuilder.cs.

56 {
57 ReadOnlyMemory<char>[] array = _array;
58 Span<ReadOnlyMemory<char>> span = new Span<ReadOnlyMemory<char>>(array, 0, _count);
59 int num = 0;
60 for (int i = 0; i < span.Length; i++)
61 {
62 num += span[i].Length;
63 }
64 string result = string.Create(num, this, delegate(Span<char> dest, SegmentStringBuilder builder)
65 {
66 Span<ReadOnlyMemory<char>> span2 = builder.AsSpan();
67 for (int j = 0; j < span2.Length; j++)
68 {
69 ReadOnlySpan<char> span3 = span2[j].Span;
70 span3.CopyTo(dest);
71 dest = dest.Slice(span3.Length);
72 }
73 });
74 span.Clear();
75 this = default(SegmentStringBuilder);
77 return result;
78 }
static ArrayPool< T > Shared
Definition ArrayPool.cs:7

References System.Span< T >.Span(), System.Text.SegmentStringBuilder._array, System.Text.SegmentStringBuilder._count, System.array, System.Text.SegmentStringBuilder.AsSpan(), System.Span< T >.Clear(), System.ReadOnlySpan< T >.CopyTo(), System.ReadOnlySpan< T >.Length, System.Span< T >.Length, System.Buffers.ArrayPool< T >.Shared, and System.Span< T >.Slice().

Referenced by System.Text.RegularExpressions.Match.Result().