question: public static String encodeTemplateNames ( String s ) { int i = s . indexOf ( '{' ) ; if ( i != - 1 ) { s = s . replace ( "{" , "%7B" ) ; } i = s . indexOf ( '}' ) ; if ( i != - 1 ) { s = s . replace ( "}" , "%7D" ) ; } return s ; }
target:  Encodes a string with template parameters names present, specifically the characters '{' and '}' will be percent-encoded.