i was just wondering if anybody could help me out with this :
StringBuilder s=new StringBuilder(\"0123456789\");
s.substring(1, 2);
System.out.printl
The Javadoc tells you whether a method modifies the instance it operates on.
substring
Returns a new String that contains a subsequence of characters currently contained in this sequence. The substring begins at the specified start and extends to the character at index end - 1.
delete
Removes the characters in a substring of this sequence. The substring begins at the specified start and extends to the character at index end - 1 or to the end of the sequence if no such character exists. If start is equal to end, no changes are made.
Hence substring doesn't change the state of the StringBuilder while delete does.