Remove backslashes that are used as escape characters
@param value
@return
480911
public static String removeBackslashEscape(String value) {
        StringBuffer sb = new StringBuffer();
        int i, n = value.length();
        char ch;
        boolean lastIsEscape = false;
        for (i=0; i<n; i++) {
            ch = value.charAt(i);
            if (lastIsEscape) {
                sb.append(ch);
                lastIsEscape = false;
            } else {
                if (ch=='\\') lastIsEscape = true;
                else sb.append(ch);
            }
        }
        return sb.toString();
    }
1351109
public static String escapeRegExp(final String value) {
        final StringBuilder buff = new StringBuilder();
        if (value == null || value.length() == 0) {
            return "";
        }
        int index = 0;
        // $( )+.[^{\
        while (index < value.length()) {
            final char current = value.charAt(index);
            switch (current) {
            case '.':
                buff.append("\\.");
                break;
                // case '/':
                // case '|':
            case '\\':
                buff.append("[\\\\|/]");
                break;
            case '(':
                buff.append("\\(");
                break;
            case ')':
                buff.append("\\)");
                break;
            case '[':
                buff.append("\\[");
                break;
            case ']':
                buff.append("\\]");
                break;
            case '{':
                buff.append("\\{");
                break;
            case '}':
                buff.append("\\}");
                break;
            case '^':
                buff.append("\\^");
                break;
            case '+':
                buff.append("\\+");
                break;
            case '$':
                buff.append("\\$");
                break;
            default:
                buff.append(current);
            }
            index++;
        }
        return buff.toString();
    }
1217987
def _escape(value):
        
        value = str(value)
        for char, escaped in {' ': '\ ', ',': '\,', '"': '\"'}.items():
            value = value.replace(char, escaped)
        return value
1264691
function escape(value) {
  return value
    .split('')
    .map(function(character) {
      return '\\u' + character.charCodeAt(0).toString(16)
    })
    .join('')
}
1130881
public static String escapeAttribute (String value)
    {
        for (int ii = 0; ii < ATTR_ESCAPES.length; ++ii) {
            value = value.replace(ATTR_ESCAPES[ii][0], ATTR_ESCAPES[ii][1]);
        }
        return value;
    }
624930
public static String trim(String value) {
    int start;
    int end;
    final int lengthMinusOne = value.length() - 1;
    for (start = 0; start <= lengthMinusOne; ++start) {
      if (!isSpace(value.charAt(start))) {
        break;
      }
    }
    for (end = lengthMinusOne; end >= start; --end) {
      if (!isSpace(value.charAt(end))) {
        break;
      }
    }
    if (start == 0 && end == lengthMinusOne) {
      return value;
    }
    if (start > lengthMinusOne) {
      return "";
    }
    return value.substring(start, end + 1);
  }
471317
private String formatValue(String[] value) {

    String ret = "";
    for(int i=0;i<value.length;i++) {
      ret += value[i];
      if(i<value.length-1) ret+="\n";
    }
    return ret;

  }
359836
public static function convertFromConcatenated($value)
    {
        //normalize remaining backslashes
        if ($value != preg_replace('/(\w)\\\/', "$1", $value)) {
            $value .= preg_replace('/(\w)\\\/', "$1", $value);
        }

        $compare = stripslashes($value);

        $pattern = array(
            '/(?:<\/\w+>\+<\w+>)/s',
            '/(?:":\d+[^"[]+")/s',
            '/(?:"?"\+\w+\+")/s',
            '/(?:"\s*;[^"]+")|(?:";[^"]+:\s*")/s',
            '/(?:"\s*(?:;|\+).{8,18}:\s*")/s',
            '/(?:";\w+=)|(?:!""&&")|(?:~)/s',
            '/(?:"?"\+""?\+?"?)|(?:;\w+=")|(?:"[|&]{2,})/s',
            '/(?:"\s*\W+")/s',
            '/(?:";\w\s*\+=\s*\w?\s*")/s',
            '/(?:"[|&;]+\s*[^|&\n]*[|&]+\s*"?)/s',
            '/(?:";\s*\w+\W+\w*\s*[|&]*")/s',
            '/(?:"\s*"\s*\.)/s',
            '/(?:\s*new\s+\w+\s*[+",])/',
            '/(?:(?:^|\s+)(?:do|else)\s+)/',
            '/(?:[{(]\s*new\s+\w+\s*[)}])/',
            '/(?:(this|self)\.)/',
            '/(?:undefined)/',
            '/(?:in\s+)/'
        );

        // strip out concatenations
        $converted = preg_replace($pattern, null, $compare);

        //strip object traversal
        $converted = preg_replace('/\w(\.\w\()/', "$1", $converted);

        // normalize obfuscated method calls
        $converted = preg_replace('/\)\s*\+/', ")", $converted);

        //convert JS special numbers
        $converted = preg_replace(
            '/(?:\(*[.\d]e[+-]*[^a-z\W]+\)*)|(?:NaN|Infinity)\W/ims',
            1,
            $converted
        );

        if ($converted && ($compare != $converted)) {
            $value .= "\n" . $converted;
        }

        return $value;
    }
124777
public static String javaQuotedLiteral(String value)
    {
        StringBuilder b = new StringBuilder(value.length() * 2);
        b.append('"');
        for (int i = 0; i < value.length(); i++) {
            char c = value.charAt(i);
            switch (c) {
                case '"': b.append("\\\""); break;
                case '\\': b.append("\\\\"); break;
                case '\n': b.append("\\n"); break;
                case '\r': b.append("\\t"); break;
                case '\t': b.append("\\r"); break;
                case '\0': b.append("\\000"); break;  // Inserting '\0' isn't safe if there's a digit after
                default:
                    if (c >= 0x20 && c <= 0x7e) {
                        b.append(c);
                    } else {
                        int h1 = (c >> 12) & 0xf;
                        int h2 = (c >> 8) & 0xf;
                        int h3 = (c >> 4) & 0xf;
                        int h4 = c & 0xf;
                        b.append("\\u");
                        b.append(hexDigit(h1));
                        b.append(hexDigit(h2));
                        b.append(hexDigit(h3));
                        b.append(hexDigit(h4));
                    }
                    break;
            }
        }
        b.append('"');
        return b.toString();
    }
602295
private String escapeQuotes(String value)
   {
      StringBuilder sb = new StringBuilder();
      int length = value.length();
      char c;

      sb.append('"');
      for (int index = 0; index < length; index++)
      {
         c = value.charAt(index);
         sb.append(c);

         if (c == '"')
         {
            sb.append('"');
         }
      }
      sb.append('"');

      return (sb.toString());
   }
648138
public static String filterHtmlAttributes(String value) {
    if (EscapingConventions.FilterHtmlAttributes.INSTANCE.getValueFilter().matcher(value).find()) {
      return value;
    }
    logger.log(Level.WARNING, "|filterHtmlAttributes received bad value ''{0}''", value);
    return EscapingConventions.FilterHtmlAttributes.INSTANCE.getInnocuousOutput();
  }
130635
public static String replaceBackSlashesWithSlashes( String string ) {
        if (string != null) {
            string = string.replaceAll("\\\\", "/").replaceAll("\\\\\\\\", "/");
        }
        return string;
    }
158142
public static String fromWellFormed(String value) {
        if (value == null) {
            return LogicalValue.ANY.getAbbreviation();
        }
        //return value.replaceAll("\\\\([^0-9A-Za-z])", "$1");
        StringBuilder buffer = new StringBuilder(value);
        char p = ' ';
        for (int x = 0; x < buffer.length() - 1; x++) {
            char c = buffer.charAt(x);
            if (c == '\\' && p != '\\') {
                buffer.delete(x, x + 1);
                x -= 1;
            }
            p = c;
        }
        return buffer.toString();
    }
1031621
@Override
    public String stripQuotes(String value) {
        if (null == value) {
            return null;
        }
        String modvalue = value.trim();
        if (0 == modvalue.length()) {
            return modvalue;
        }
        boolean needTrimming = false;
        int start = 0;
        if ('"' == modvalue.charAt(0) || '\'' == modvalue.charAt(0)) {
            start = 1;
            needTrimming = true;
        }
        int end = modvalue.length() - 1;
        if ('"' == modvalue.charAt(end) || '\'' == modvalue.charAt(end)) {
            needTrimming = true;
        } else {
            end++;
        }
        if (needTrimming) {
            return modvalue.substring(start, end);
        }
        return modvalue;
    }
1057784
public static String removeSimpleHTML(String value) {
		String rex = "<^[>]+/>|" + TAG + "[^<]*</[^>]*>|" + TAG;
		if (value == null || value.equals("")) return "";
		return value.replaceAll(rex, "");
	}
197792
public static String fixValue(String value) {
		if (value != null && !value.equals("")) {
			final String[] words = value.toLowerCase().split("_");
			value = "";
			for (final String word : words) {
				if (word.length() > 1) {
					value += word.substring(0, 1).toUpperCase() + word.substring(1) + " ";
				} else {
					value = word;
				}
			}
		}
		if (value.contains("\\n")) {
			value = value.replace("\\n", System.getProperty("line.separator"));
		}
		return value;
	}
302783
protected String replaceSimple(final String value) {
        String str = value;
        for(int i=0; i < numMap.length; i++) {
            str = str.replaceAll(String.valueOf(i), numMap[i]);
        }

        return str;
    }