Java String Quote quoteText(String text)

Here you can find the source of quoteText(String text)

Description

quote Text

License

Open Source License

Declaration

private static String quoteText(String text) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static String quoteText(String text) {
        String txt = text.replaceAll("\n", "\\\\n");

        txt = txt.replaceAll("\r", "\\\\r");
        txt = txt.replaceAll("\t", "\\\\t");
        return "\"" + txt + "\"";
    }/*w ww .j ava2 s .  c  om*/
}

Related

  1. quoteString(String value, boolean force)
  2. quoteStringLiteral(String string)
  3. quoteStringSQL(String s)
  4. quoteStringSQL(String s)
  5. quoteStringValue(String value)
  6. quoteText(String textToQuote, boolean sbAppend)
  7. quoteTo(CharSequence cs, StringBuilder target)
  8. quoteTokenize(String clientResponse)
  9. QuoteValue(String str)