lastindexof与indexof相反,是从test字符穿的结尾开始往前查
str.indexany(char[]);
char[] mb={"d","c","d1"};
test.indexany(mb)//返回这个mb数组中任何一个值在这个test字符穿中的最先出现位置的字符的下标.
lastindexany与之刚好与之相反
"abcdefg".substring(4,2)
返回的值为:ef
从字符串"abcdefg"中第4位开始取,取到第2位。
"abcdefg".substring(4)
返回:efg
从字符串"abcdefg"中第4位开始取,取到字符串的尾部.
remove 去除int位算起后面的部分.
eg:
temp2=c:/##/rece.exe
temp2 = temp2.Substring(temp2.LastIndexOf(@"/")+1);
temp2 = temp2.Remove(temp2.LastIndexOf(@".") );
temp2=>rece