javamate06
asked on
Checking the extension of the file
If I have a file which has name name.zz
I want to check
if (name have extension zz)
{
// Do something
}
else
{
System.out.println(“The file is not a zz file”);
}
Is there a way to check the extension of the file?
I want to check
if (name have extension zz)
{
// Do something
}
else
{
System.out.println(“The file is not a zz file”);
}
Is there a way to check the extension of the file?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
if (name.lastIndexOf(".zz") == name.length() - 3)