question: private static String deleteQuotes ( String quotedString ) { int indexOfQuote = quotedString . indexOf ( '\'' ) ; if ( indexOfQuote < 0 ) { int newLength = quotedString . length ( ) ; while ( newLength > 0 && AsciiFuncs . isWhitespace ( quotedString . charAt ( newLength - 1 ) ) ) { newLength -- ; } return quotedString . substring ( 0 , newLength ) ; } else { int lastIndexOfQuote = 0 ; StringBuffer sb = new StringBuffer ( quotedString . length ( ) ) ; while ( indexOfQuote >= 0 ) { sb . append ( quotedString , lastIndexOfQuote , indexOfQuote ) ; lastIndexOfQuote = indexOfQuote + 1 ; indexOfQuote = quotedString . indexOf ( '\'' , lastIndexOfQuote + 1 ) ; } sb . append ( quotedString , lastIndexOfQuote , quotedString . length ( ) ) ; int newLength = sb . length ( ) ; while ( newLength > 0 && AsciiFuncs . isWhitespace ( sb . charAt ( newLength - 1 ) ) ) { newLength -- ; } sb . setLength ( newLength ) ; return sb . toString ( ) ; } }
target:  delete the start and trailing quote from the sting and replace all (escaped)double quotes with a single quote. Then trim the trailing blanks.