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

◆ LastIndexOf() [15/15]

int System.Globalization.CompareInfo.LastIndexOf ( string source,
string value,
int startIndex,
int count,
CompareOptions options )
inline

Definition at line 894 of file CompareInfo.cs.

895 {
896 if (source == null)
897 {
898 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
899 }
900 if (value == null)
901 {
902 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value);
903 }
904 while ((uint)startIndex >= (uint)source.Length)
905 {
906 if (startIndex == -1 && source.Length == 0)
907 {
908 count = 0;
909 break;
910 }
911 if (startIndex == source.Length)
912 {
913 startIndex--;
914 if (count > 0)
915 {
916 count--;
917 }
918 continue;
919 }
920 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.startIndex, ExceptionResource.ArgumentOutOfRange_Index);
921 break;
922 }
924 if (!source.TryGetSpan(startIndex, count, out var slice))
925 {
926 ThrowHelper.ThrowCountArgumentOutOfRange_ArgumentOutOfRange_Count();
927 }
928 int num = LastIndexOf(slice, value, options);
929 if (num >= 0)
930 {
931 num += startIndex;
932 }
933 return num;
934 }
int LastIndexOf(string source, char value)

References System.count, System.Globalization.CompareInfo.LastIndexOf(), System.options, System.source, System.startIndex, System.ThrowHelper.ThrowArgumentNullException(), System.ThrowHelper.ThrowArgumentOutOfRangeException(), System.ThrowHelper.ThrowCountArgumentOutOfRange_ArgumentOutOfRange_Count(), and System.value.