返回目标字符串中的子字符串的索引。
命名空间: 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 值。