Java String Escape escape(final String s)

Here you can find the source of escape(final String s)

Description

escape

License

Open Source License

Declaration

public static String escape(final String s) 

Method Source Code

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

import java.io.UnsupportedEncodingException;

import java.net.URLEncoder;

public class Main {
    public static String escape(final String s) {
        try {//from  ww  w.  j av  a  2  s  . c  om
            return URLEncoder.encode(s, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            return s;
        }
    }
}

Related

  1. addEscapes(String str)
  2. addEscapeSequence(String inputStr)
  3. addEscapesToCode(String code)
  4. addEscChar(String str)
  5. escape(final @Nonnull String string)
  6. escape(final String value)
  7. escape(String original)
  8. escape(String s)
  9. escape(String s)