# java formatting method for c++ setw()



## coorrel (Aug 26, 2002)

I have a StringBuffer class that that returns its toString, containing multiple lines of text, I would like to have around 5 spaces infront of the block of the returned toString()... 
I've searched the web for a while now and came to the conclusion it can't be done without importing other classes or is there an some kind of workaround with this making those columns?


----------



## Chicon (Jul 29, 2004)

Hi coorrel,

I guess you mean something like this :

*


Code:


[SIZE=2]
StringBuffer sb;
...
String result = "     " + sb.toString();  
[/SIZE]

*


----------

