Reputation: 49
I tried to append a long String (length of 3000) with java StringBuilder and found out that the appended result is not what I expected.
A.append(B)
should be AB
A.append(LongString)
becomes A________________(empty spaces)
Any idea?
My code: http://pastebin.com/5CPmHFeS
Upvotes: 0
Views: 1211
Reputation: 46425
There isn't any problem, that I see.
It works properly : http://www.ideone.com/z8Lxu
Upvotes: 0
Reputation: 1806
What did you get as output? I got:
sb-320 :404040....
sb-4320:404040....
Truncated for readability, but its correct. I think you may have counted the digits incorrectly. Double check?
Upvotes: 1