public int indexof(String str)返回字符串中出現str的第一個位置
public int indexof(String str,int fromIndex)返回字符串中從fromIndex開始出現str的第一個位置
public String substring(int beginIndex)返回從beginIndex開始的字符串
public String lastIndexOf(String str)返回從str最后一次出現的位置
如:
String pexfix = fileName.substring( fileName.lastIndexOf("."), fileName.length());
返回字符串pexfix中以.結束的位置到整個字符串結束之間的字符串,即獲取后綴名