Created
March 16, 2016 19:46
-
-
Save y0zg/193e9cb1092d93265b1f to your computer and use it in GitHub Desktop.
extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String getFileExtension(String path) { | |
int lastIndex = path.lastIndexOf("."); | |
if (lastIndex != -1) { | |
return path.substring(lastIndex + 1); | |
} else { | |
return ""; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment