Here you can find the source of addEscapes(String s)
public static String addEscapes(String s)
//package com.java2s; /*// w w w . j a va 2 s .co m * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ public class Main { public static String addEscapes(String s) { s = s.replace("\r", "\\r"); s = s.replace("\n", "\\n"); return s = s.replace("\"", "\\\""); } }