question: protected String escape ( String s ) { StringBuffer result ; int i ; result = new StringBuffer ( ) ; for ( i = 0 ; i < s . length ( ) ; i ++ ) { if ( ( s . charAt ( i ) == '(' ) || ( s . charAt ( i ) == ')' ) ) { result . append ( '\\' ) ; } result . append ( s . charAt ( i ) ) ; } return result . toString ( ) ; }
target:  Escapes brackets in the string with backslashes.