Here you can find the source of quote(String str)
static String quote(String str)
//package com.java2s; import java.util.ArrayList; public class Main { static String quote(String str) { String ret = ""; String[] elems = str.split("\n"); ArrayList<String> filtered_elems = new ArrayList<String>(); for (int i = 0; i < elems.length; ++i) { // if(elems[i]) if (elems[i].length() > 0) { ret += ">" + elems[i].trim() + "\n"; }// w ww . ja v a 2s .c o m } return ret; } }