Here you can find the source of encode(String raw)
Encode the message by replacing all the white spaces with %20.
Parameter | Description |
---|---|
raw | Output data from the RESOLVE compiler. |
public static String encode(String raw)
//package com.java2s; //License from project: BSD License import java.io.UnsupportedEncodingException; import java.net.URLEncoder; public class Main { /**//from w w w . ja va 2 s . c om * <p>Encode the message by replacing all the white spaces with %20.</p> * * @param raw Output data from the RESOLVE compiler. * * @return The encoded data for WebIDE. */ public static String encode(String raw) { String encoded = null; try { encoded = URLEncoder.encode(raw.replaceAll(" ", "%20"), "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return encoded; } }