private static String unquote ( String s ) { while ( s . startsWith ( "\"" ) || s . startsWith ( "'" ) ) { s = s . substring ( 1 ) ; } while ( s . endsWith ( "\"" ) || s . endsWith ( "'" ) ) { s = s . substring ( 0 , s . length ( ) - 1 ) ; } return s ; }
Fuzzy unquoting mechanism that works also with somewhat malformed quotes .