public static String stripEscape(String pattern){
  if (pattern == null)   return null;
  StringBuilder stripped=new StringBuilder(pattern.length());
  for (int pos=0; pos < pattern.length(); pos++) {
    char ch=pattern.charAt(pos);
    if (ch != '\\') {
      stripped.append(ch);
    }
 else     if (pos < pattern.length() - 1 && pattern.charAt(pos + 1) == '\\') {
      stripped.append('\\');
      pos+=1;
    }
  }
  return stripped.toString();
}

public static String stripEscape ( String pattern ) { if ( pattern == null ) return null ; StringBuilder stripped = new StringBuilder ( pattern . length ( ) ) ; for ( int pos = 0 ; pos < pattern . length ( ) ; pos ++ ) { char ch = pattern . charAt ( pos ) ; if ( ch != '\\' ) { stripped . append ( ch ) ; } else if ( pos < pattern . length ( ) - 1 && pattern . charAt ( pos + 1 ) == '\\' ) { stripped . append ( '\\' ) ; pos += 1 ; } } return stripped . toString ( ) ; }
strips all backslash - escapes from a string .
