From: Charles McGarvey Date: Wed, 13 Jul 2011 18:21:20 +0000 (-0600) Subject: rename quote method to escape X-Git-Tag: v0.3.2~5 X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fvimcoder;a=commitdiff_plain;h=c4d7e0da9accfe7aed04c768892b08e18ad085fd rename quote method to escape --- diff --git a/src/com/dogcows/Util.java b/src/com/dogcows/Util.java index 3253ae2..412ef4a 100644 --- a/src/com/dogcows/Util.java +++ b/src/com/dogcows/Util.java @@ -61,12 +61,12 @@ public abstract class Util } /** - * Quote a string by replacing prepending backslashes and double + * Escape a string by replacing prepending backslashes and double * quotation characters with an extra backslash. - * @param The string to be quoted. - * @return The quoted string. + * @param The string to be escaped. + * @return The escaped string. */ - public static String quote(String a) + public static String escape(String a) { a = a.replaceAll("\\\\", "\\\\\\\\"); a = a.replaceAll("\"", "\\\\\\\""); @@ -151,8 +151,7 @@ public abstract class Util String text = template; for (String key : terms.keySet()) { - text = text.replaceAll("\\$" + key + "\\$", - Util.quote(terms.get(key))); + text = text.replaceAll("\\$" + key + "\\$", Util.escape(terms.get(key))); } return text; }