Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.text.TextUtils;

public class Main {

    public static String getFileExtension(String path) {
        if (TextUtils.isEmpty(path)) {
            return null;
        }
        int index = path.lastIndexOf(".");
        if (index == -1 || index == path.length() - 1) {
            return null;
        }

        return path.substring(index + 1);
    }
}