Android URL Encode encodeUrlParam(String s)

Here you can find the source of encodeUrlParam(String s)

Description

encode Url Param

Declaration

public static String encodeUrlParam(String s) 

Method Source Code

//package com.java2s;

import java.io.UnsupportedEncodingException;

import java.net.URLEncoder;

public class Main {
    public static String encodeUrlParam(String s) {
        try {/*w  w  w  . ja va  2  s  .c om*/
            return URLEncoder.encode(s.replace("/", "%2F"), "UTF-8")
                    .replace("+", "%20");
        } catch (UnsupportedEncodingException e) {
            return s;
        }
    }
}

Related

  1. encode(String s)
  2. encodeParams(ArrayList params)
  3. encodeUrl(Bundle parameters)
  4. encodeUriSegment(String segment)
  5. encodeUrl(Bundle parameters)
  6. weakUrlEncode(String url)
  7. encode(String s)
  8. getParams(Map params, String encode)
  9. encodeParameters(Map params)