Here you can find the source of extractFileNames(String[] fileNames)
public static String[] extractFileNames(String[] fileNames)
//package com.java2s; //License from project: Open Source License public class Main { public static String[] extractFileNames(String[] fileNames) { String[] newFileNames = new String[fileNames.length]; for (int i = 0; i < fileNames.length; i++) { newFileNames[i] = extractFileName(fileNames[i]); }//from www . ja v a 2s.c om return newFileNames; } public static String extractFileName(String fileName) { String newFileName = ""; String tempStr = ""; int counter = fileName.length() - 1; char ch = fileName.charAt(counter); while (ch != '/') { counter--; tempStr += ch; ch = fileName.charAt(counter); } for (int i = tempStr.length() - 1; i >= 0; i--) { newFileName += tempStr.charAt(i); } return newFileName; } }