Created
June 11, 2016 14:37
-
-
Save brendandawes/b1d143c79575e72741c0d3c691f59ce1 to your computer and use it in GitHub Desktop.
URL encode text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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