Here you can find the source of imageUrl_2_ImageName(String imageUrl)
public static String imageUrl_2_ImageName(String imageUrl)
//package com.java2s; public class Main { public static String imageUrl_2_ImageName(String imageUrl) { if (imageUrl == null || imageUrl.isEmpty() || !imageUrl.contains("http://")) { return null; }//w ww . j a va2s.c om int start = imageUrl.lastIndexOf('/'); if (start == -1) { return null; } int end = imageUrl.lastIndexOf('.'); if (end == -1) { return null; } if (end <= start + 1) { return null; } return imageUrl.substring(start + 1, end); } }