StringBuffer?
One of hundreds of answers available with our premium content service.
A: The StringBuffer insert(int, String) method can be used to pad the buffer at specific locations. The method inserts the given string at the offset position indicated by the int value and shifts the original buffer contents right. The original string contents are preserved and the buffer length is increased by the length of the inserted string.
… full answer hidden
Premium members click below for full answer
How can I pad a StringBuffer?