public static String [ ] decodeArray ( final String val ) { if ( val == null ) { return null ; } int len = val . length ( ) ; if ( len == 0 ) { return new String [ 0 ] ; } ArrayList < String > al = new ArrayList < String > ( ) ; int i = 0 ; while ( i < len ) { int end = val . indexOf ( " " , i ) ; String s ; if ( end < 0 ) { s = val . substring ( i ) ; i = len ; } else { s = val . substring ( i , end ) ; i = end + 1 ; } try { if ( s . equals ( "\t" ) ) { al . add ( null ) ; } else { al . add ( URLDecoder . decode ( s , "UTF-8" ) ) ; } } catch ( Throwable t ) { throw new RuntimeException ( t ) ; } } return al . toArray ( new String [ al . size ( ) ] ) ; }
Return a StringArray resulting from decoding the given String which should have been encoded by encodeArray