Java URL Encode encode(String value)

Here you can find the source of encode(String value)

Description

encode

License

Open Source License

Declaration

static String encode(String value) throws UnsupportedEncodingException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.UnsupportedEncodingException;

import java.net.URLEncoder;

public class Main {
    static String encode(String value) throws UnsupportedEncodingException {
        if (value != null) {
            return URLEncoder.encode(value, "utf8");
        } else {/*  ww  w  .java 2 s.  c  o  m*/
            return "";
        }

    }
}

Related

  1. encode(String string)
  2. encode(String strInput)
  3. encode(String text)
  4. encode(String toBeEncoded, String charSet, String defaultReturnValue)
  5. encode(String value)
  6. encode(String value)
  7. encode(String value)
  8. encode(String value, String charset)
  9. encode(String value, String encoding)