Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.net.Uri;

public class Main {
    /**
     * decodeWithoutQuery
     *
     * @param uri uri
     * @return uri
     */
    public static String decodeWithoutQuery(Uri uri) {
        if (uri == null) {
            return "";
        }
        String URI = uri.toString();
        return decodeWithoutQuery(URI);
    }

    /**
     * decodeWithoutQuery
     *
     * @param uri uri
     * @return uri
     */
    public static String decodeWithoutQuery(String uri) {
        int index = uri.indexOf('?');
        if (index > 0) {
            uri = uri.substring(0, index);
        }
        return uri;
    }
}