substring从指定字符串开始截取

String filename=F:\workspace\ssh_photo\WebContent\uploadFile\1444783552338pic.jpg ;
int begin=useName.indexOf(“ssh_photo”);
int last=useName.length();
System.out.println(useName.substring(begin,last)); 

想要截取指定字符串及其之后的字符串:ssh_photo及其之后的字符串。

最后输出得到:ssh_photo\WebContent\uploadFile\1444783552338pic.jpg

猜你喜欢

转载自blog.csdn.net/qq_31293575/article/details/81612486