傳回目標字串中的子字串索引。
命名空間: System.Data.Services.Providers
組件: Microsoft.Data.Services (在 Microsoft.Data.Services.dll 中)
語法
'宣告
Public Shared Function IndexOf ( _
targetString As Object, _
substring As Object _
) As Object
'用途
Dim targetString As Object
Dim substring As Object
Dim returnValue As Object
returnValue = OpenTypeMethods.IndexOf(targetString, _
substring)
public static Object IndexOf(
Object targetString,
Object substring
)
public:
static Object^ IndexOf(
Object^ targetString,
Object^ substring
)
static member IndexOf :
targetString:Object *
substring:Object -> Object
public static function IndexOf(
targetString : Object,
substring : Object
) : Object
參數
- targetString
型別:System.Object
目標字串。
- substring
型別:System.Object
要尋找的子字串。
傳回值
型別:System.Object
傳回 targetString 中 substring 位置的索引。
備註
在 targetString 中找不到 substring 時,IndexOf 方法會傳回 null 值。