共用方式為


CompareInfo.IndexOf Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Include Protected Members
Include Inherited Members

Include Silverlight Members
Include Silverlight for Windows Phone Members
Include XNA Framework Members

Returns the zero-based index of the first occurrence of a value within a string or within a portion of it.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

  Name Description
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 IndexOf(String, Char) Searches for the specified character and returns the zero-based index of the first occurrence within the entire source string.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 IndexOf(String, String) Searches for the specified substring and returns the zero-based index of the first occurrence within the entire source string.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 IndexOf(String, Char, CompareOptions) Searches for the specified character and returns the zero-based index of the first occurrence within the entire source string using the specified CompareOptions value.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 IndexOf(String, String, CompareOptions) Searches for the specified substring and returns the zero-based index of the first occurrence within the entire source string using the specified CompareOptions value.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 IndexOf(String, Char, Int32, CompareOptions) Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string using the specified CompareOptions value.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 IndexOf(String, Char, Int32, Int32) Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 IndexOf(String, String, Int32, CompareOptions) Searches for the specified substring and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string using the specified CompareOptions value.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 IndexOf(String, String, Int32, Int32) Searches for the specified substring and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 IndexOf(String, Char, Int32, Int32, CompareOptions) Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements using the specified CompareOptions value.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 IndexOf(String, String, Int32, Int32, CompareOptions) Searches for the specified substring and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements using the specified CompareOptions value.

Top