This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Saurabh Naik wrote:suppose this is mystring = c:\my\you\image.jpg
and I want only image.jpg.
If you want only name of the file, then I suggest don't go for split method, instead use String#subString(int, int0 method, the first parameter is the index of last "\"(String has a method for this, search Java Docs) and second param is length of string.