public String differenceBetweenIgnoreWhitespaceAnd ( String first , String second ) { String cleanFirst = allWhitespaceToSingleSpace ( first ) ; String cleanSecond = allWhitespaceToSingleSpace ( second ) ; String cleanDiff = differenceBetweenAnd ( cleanFirst , cleanSecond ) ; if ( cleanDiff != null ) { if ( ( "<div>" + cleanFirst + "</div>" ) . equals ( cleanDiff ) ) { cleanDiff = "<div>" + first + "</div>" ; } else if ( cleanFirst != null && cleanFirst . equals ( cleanDiff ) ) { cleanDiff = first ; } } return cleanDiff ; }
Determines difference between two strings ignoring whitespace changes .