Java String Escape addEscapes(String s)

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

Description

add Escapes

License

LGPL

Declaration

public static String addEscapes(String s) 

Method Source Code

//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("\"", "\\\"");
    }
}

Related

  1. addEscape(String a_unescaped)
  2. addEscapeCapacityToRegex(String inputRegex)
  3. addEscapeChar(String str)
  4. addEscapeCharactersForSpaces(String s)
  5. addEscapeCharsToBackSlash(String code)
  6. addEscapes(String str)
  7. addEscapeSequence(String inputStr)
  8. addEscapesToCode(String code)
  9. addEscChar(String str)