Java String Escape escapeWiki(String s)

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

Description

escape Wiki

License

Open Source License

Declaration

public static String escapeWiki(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 escapeWiki(String s) {
        s = s.replaceAll(" ", "_");
        s = s.replaceAll("\\t", "_");
        try {/*from   w w w  .  java2  s . co m*/
            s = URLEncoder.encode(s, "UTF8");
            return s;
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }
}

Related

  1. escapeSolr(String value)
  2. escapeToFileName(String name)
  3. escapeUnicode(String s)
  4. escapeUnicodeString(final String input, final boolean escapeAscii)
  5. escapeUnsafeCharacters(String anyURI, boolean escapePercent)
  6. escapeXML(String message)
  7. escapeXml(String str)
  8. escapeXML(String str)
  9. percentEncode(String s)