IndexOf
public:
int IndexOf(
String^ value,
int startIndex,
int count
)
说明:
-
value
-
类型:
System..::.String
要查找的 String。
-
startIndex
-
类型:
System..::.Int32
搜索起始位置。
-
count
-
类型:
System..::.Int32
要检查的字符位置数。
返回值
类型: System..::.Int32如果找到该字符串,则为 value 的从零开始的索引位置;如果未找到该字符串,则为 -1。如果 value 为 Empty,则返回值为 startIndex。
public:
String^ Substring(
int startIndex,
int length
)
返回值
类型: System..::.String一个 String,它等于此实例中从 startIndex 开始的长度为 length 的子字符串,如果 startIndex 等于此实例的长度且 length 为零,则为 Empty。
PS:
从MSDN上复制过来。最近在制作一个字符串处理的功能,时常用到此方法