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

◆ SplitWithoutPostProcessing()

string[] System.String.SplitWithoutPostProcessing ( ReadOnlySpan< int > sepList,
ReadOnlySpan< int > lengthList,
int defaultLength,
int count )
inlineprivate

Definition at line 2758 of file String.cs.

2759 {
2760 int num = 0;
2761 int num2 = 0;
2762 count--;
2763 int num3 = ((sepList.Length < count) ? sepList.Length : count);
2764 string[] array = new string[num3 + 1];
2765 for (int i = 0; i < num3; i++)
2766 {
2767 if (num >= Length)
2768 {
2769 break;
2770 }
2771 array[num2++] = Substring(num, sepList[i] - num);
2772 num = sepList[i] + (lengthList.IsEmpty ? defaultLength : lengthList[i]);
2773 }
2775 {
2776 array[num2] = Substring(num);
2777 }
2778 else if (num2 == num3)
2779 {
2780 array[num2] = Empty;
2781 }
2782 return array;
2783 }
string Substring(int startIndex)
Definition String.cs:2992
static readonly string Empty
Definition String.cs:29

References System.array, System.count, System.String.Empty, System.String.Length, and System.String.Substring().

Referenced by System.String.SplitInternal(), System.String.SplitInternal(), and System.String.SplitInternal().