Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.net.URLEncoder;

public class Main {
    /**
     * url Encode
     *
     * @param content
     * @return
     */
    public static String getUrlEncodeString(String content) {
        String content_ = content;
        try {
            content_ = URLEncoder.encode(content, "utf-8").replace("+", "%20");
        } catch (Exception e) {
            content_ = content;
        }
        return content_;
    }
}