Android URL Encode urlEncode(String string)

Here you can find the source of urlEncode(String string)

Description

url Encode

Declaration

public static String urlEncode(String string)
            throws UnsupportedEncodingException 

Method Source Code

//package com.java2s;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class Main {
    public static final String UTF8_ENCODING = "UTF-8";

    public static String urlEncode(String string)
            throws UnsupportedEncodingException {
        return URLEncoder.encode(string, UTF8_ENCODING).replace("+", "%20");
    }/*from   w  w  w. j  ava2 s. com*/
}

Related

  1. encodeURI(String encoded)
  2. encode(String base)
  3. encode(String url)
  4. urlEncode(String url)
  5. encodeURL(String value)
  6. getURLEncodeStr(String url)
  7. getUrlCode(String pageUrl)
  8. urlEncode(String in)
  9. encode(String s)