String fileName="http://dd12138.png" String type = fileName.substring(fileName.lastIndexOf(".")+1); 结果: png