Here you can find the source of addEscapeSequence(String inputStr)
Parameter | Description |
---|---|
inputStr | a parameter |
public static String addEscapeSequence(String inputStr)
//package com.java2s; public class Main { /**/* w w w. ja v a2s . c om*/ * @param inputStr * @return String */ public static String addEscapeSequence(String inputStr) { if (inputStr.contains("\\")) { inputStr = inputStr.replace("\\", "\\\\"); } if (inputStr.contains("\'")) { inputStr = inputStr.replace("\'", "\\\'"); } if (inputStr.contains("\"")) { inputStr = inputStr.replace("\"", "\\\""); } return inputStr; } }