Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Map;
import java.util.Set;

public class Main {
    /**
     * conver map to params string
     * @param map
     * @return
     */
    public static String covertMapToParamStr(Map<String, String> map) {
        StringBuilder sb = new StringBuilder();
        Set<String> set = map.keySet();
        for (String key : set) {
            sb.append("&");
            sb.append(key).append("=").append(map.get(key));
        }

        return sb.toString().substring(1);
    }
}