1. In java how would you compare two StringBuilders and copy only the difference of the two, into one stackoverflow.comIn java is there any elegant way to compare two different StringBuilders and copy only the difference of the two, into one?
|
2. Effective value comparison of StringBuilder objects forums.oracle.comWhy not just sb.equals(sb1)? As far as comparing two strings with equals() vs contentEquals() is concerned there is nothing in the documented API that suggests any difference "from a performance perspective". And it would seem a bit weird if they did something different (or differently) when comparing two strings. The StringBuilder documentation does say that StringBulder's toString() creates a new String ... |