private static String decode ( final String str , final int firstPercent ) { StringBuilder builder = new StringBuilder ( ) ; builder . append ( str . substring ( 0 , firstPercent ) ) ; appendDecoded ( builder , str , firstPercent ) ; for ( int i = firstPercent + 3 ; i < str . length ( ) ; ++ i ) { if ( str . charAt ( i ) == ' ' ) { appendDecoded ( builder , str , i ) ; i += 2 ; } else { builder . append ( str . charAt ( i ) ) ; } } return builder . toString ( ) ; }
Percent - decodes the given string .