Hi folks,
really simple question here (more to confirm my thoughts, than anything)...
Java method : [StringBuffer.Delete]1;
[1]: http://java.sun.com/j2se/1.4.2/docs/api/java/lang/StringBuffer.html#delete(int, int)
Java Code: sb.delete(sb.length()-2, sb.length());
C# (not sure if this is right):
StringBuilder sb = new StringBuilder();
....
sb.Remove(sb.Length - 2, sb.Length - (sb.Length - 2));
The reason why i'm not sure is in the documentation of the java delete method. It says
The substring begins at the specified start and extends to the character at index end - 1 or to the end of the StringBuffer if no such character exists
I'm just not too sure about this end - 1 bit of that quote .. and if i might have fraked things up.
cheers :)
edit: Heh. i knew that it was deleting the last 2 chars from the string, but i was keeping the conversion exact, hencse my verbose code. :)