Skip to content

Instantly share code, notes, and snippets.

@dtulig
Created October 11, 2011 02:04
Show Gist options
  • Save dtulig/1277093 to your computer and use it in GitHub Desktop.
Save dtulig/1277093 to your computer and use it in GitHub Desktop.
final Map<String, String> input = new HashMap<String, String>() {{
put("param", "v");
put("p2", "v2");
put("q", "java");
}};
final String result = Joiner.on("&")
.withKeyValueSeparator("=")
.join(input);
// Result: "p2=v2&param=v&q=java"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment