Java URL Encode encode(String s)

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

Description

encode

License

Apache License

Declaration

public static String encode(String s) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.URLEncoder;

public class Main {

    public static String encode(String s) {
        String ret = s;/*w w w. j av  a2s . c  o m*/
        try {
            ret = URLEncoder.encode(s.trim(), "UTF-8");
        } catch (Exception localException) {
        }
        return ret;
    }
}

Related

  1. encode(String from, String to, String word)
  2. encode(String in)
  3. encode(String input)
  4. encode(String input)
  5. encode(String raw)
  6. encode(String s)
  7. encode(String s)
  8. encode(String s)
  9. encode(String s)