static private LastIndexOfStringOrdinalIgnoreCase ( String source, String value, int startIndex, int count ) : int | ||
source | String | |
value | String | |
startIndex | int | |
count | int | |
리턴 | int |
public virtual unsafe int LastIndexOf(string source, string value, int startIndex, int count, CompareOptions options) { if (source == null) { throw new ArgumentNullException("source"); } if (value == null) { throw new ArgumentNullException("value"); } if ((((options & ~(CompareOptions.IgnoreWidth | CompareOptions.IgnoreKanaType | CompareOptions.IgnoreSymbols | CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase)) != CompareOptions.None) && (options != CompareOptions.Ordinal)) && (options != CompareOptions.OrdinalIgnoreCase)) { throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"), "options"); } if ((source.Length == 0) && ((startIndex == -1) || (startIndex == 0))) { if (value.Length != 0) { return(-1); } return(0); } if ((startIndex < 0) || (startIndex > source.Length)) { throw new ArgumentOutOfRangeException("startIndex", Environment.GetResourceString("ArgumentOutOfRange_Index")); } if (startIndex == source.Length) { startIndex--; if (count > 0) { count--; } if (((value.Length == 0) && (count >= 0)) && (((startIndex - count) + 1) >= 0)) { return(startIndex); } } if ((count < 0) || (((startIndex - count) + 1) < 0)) { throw new ArgumentOutOfRangeException("count", Environment.GetResourceString("ArgumentOutOfRange_Count")); } if (options == CompareOptions.OrdinalIgnoreCase) { return(TextInfo.LastIndexOfStringOrdinalIgnoreCase(source, value, startIndex, count)); } if (!this.IsSynthetic) { return(LastIndexOfString(this.m_pSortingTable, this.m_sortingLCID, source, value, startIndex, count, (int)options)); } if (options == CompareOptions.Ordinal) { return(LastIndexOfString(CultureInfo.InvariantCulture.CompareInfo.m_pSortingTable, this.m_sortingLCID, source, value, startIndex, count, (int)options)); } return(this.SyntheticLastIndexOf(source, value, startIndex, count, GetNativeCompareFlags(options))); }
public virtual int LastIndexOf(string source, string value, int startIndex, int count, CompareOptions options) { if (source == null) { throw new ArgumentNullException("source"); } if (value == null) { throw new ArgumentNullException("value"); } if ((((options & ~(CompareOptions.IgnoreWidth | CompareOptions.IgnoreKanaType | CompareOptions.IgnoreSymbols | CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase)) != CompareOptions.None) && (options != CompareOptions.Ordinal)) && (options != CompareOptions.OrdinalIgnoreCase)) { throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"), "options"); } if ((source.Length == 0) && ((startIndex == -1) || (startIndex == 0))) { if (value.Length != 0) { return(-1); } return(0); } if ((startIndex < 0) || (startIndex > source.Length)) { throw new ArgumentOutOfRangeException("startIndex", Environment.GetResourceString("ArgumentOutOfRange_Index")); } if (startIndex == source.Length) { startIndex--; if (count > 0) { count--; } if (((value.Length == 0) && (count >= 0)) && (((startIndex - count) + 1) >= 0)) { return(startIndex); } } if ((count < 0) || (((startIndex - count) + 1) < 0)) { throw new ArgumentOutOfRangeException("count", Environment.GetResourceString("ArgumentOutOfRange_Count")); } if (options == CompareOptions.OrdinalIgnoreCase) { return(TextInfo.LastIndexOfStringOrdinalIgnoreCase(source, value, startIndex, count)); } return(InternalFindNLSStringEx(this.m_dataHandle, this.m_sortName, GetNativeCompareFlags(options) | 0x800000, source, count, startIndex, value, value.Length)); }
public static int OrdinalLastIndexOfIgnoreCase(String source, String value, int startIndex, int count) { return(TextInfo.LastIndexOfStringOrdinalIgnoreCase(source, value, startIndex, count)); }