Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Capture.cs
Go to the documentation of this file.
2
3public class Capture
4{
5 public int Index { get; private protected set; }
6
7 public int Length { get; private protected set; }
8
9 internal string Text { get; set; }
10
11 public string Value => Text.Substring(Index, Length);
12
13 public ReadOnlySpan<char> ValueSpan => Text.AsSpan(Index, Length);
14
15 internal Capture(string text, int index, int length)
16 {
17 Text = text;
18 Index = index;
19 Length = length;
20 }
21
22 public override string ToString()
23 {
24 return Value;
25 }
26
28 {
29 return Text.AsMemory(0, Index);
30 }
31
33 {
34 return Text.AsMemory(Index + Length, Text.Length - Index - Length);
35 }
36}
ReadOnlyMemory< char > GetRightSubstring()
Definition Capture.cs:32
ReadOnlySpan< char > ValueSpan
Definition Capture.cs:13
ReadOnlyMemory< char > GetLeftSubstring()
Definition Capture.cs:27
Capture(string text, int index, int length)
Definition Capture.cs:15