Skip to content

Instantly share code, notes, and snippets.

@brendandawes
Created June 11, 2016 14:37
Show Gist options
  • Save brendandawes/b1d143c79575e72741c0d3c691f59ce1 to your computer and use it in GitHub Desktop.
Save brendandawes/b1d143c79575e72741c0d3c691f59ce1 to your computer and use it in GitHub Desktop.
URL encode text
String encodeURL(String s){
try {
String encoded = URLEncoder.encode(s, "UTF-8");
return encoded;
} catch (Exception e) {
return "ERROR";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment