Java examples for java.lang:String Quote
The following code shows how to escape Quote.
//package com.java2s; public class Main { public static void main(String[] argv) { String s = "book\"2s.com"; System.out.println(escapeQuote(s)); }//from w w w. jav a2 s. c o m public static String escapeQuote(String s) { return s.replaceAll("\"", "\\\""); } }