thanks
henk
> Hi what is the equivalent to the C++ setw() function in java?
Java doesn't have C++'s iostreams. What is it you actually need to
accomplish?
Print strings in 'neat' columns to a mono-spaced text output. Nothing
fancy really; it just needs to fill up a string with spaces up to the
given width, or give the orginal string back if it's equal or larger
than the given size.
It's a utility function of no more than a few lines, but I don't
really like to sprinkle my code with such utility funtions if there is
an alternative available in the standard libray. Unfortunately, there
seems to be none...
>
>Print strings in 'neat' columns to a mono-spaced text output. Nothing
>fancy really; it just needs to fill up a string with spaces up to the
>given width, or give the orginal string back if it's equal or larger
>than the given size.
Misc.rightPad and brothers downloadable as part of
http://mindprod.com/products.html#BUS
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
> Print strings in 'neat' columns to a mono-spaced text output. Nothing
> fancy really; it just needs to fill up a string with spaces up to the
> given width, or give the orginal string back if it's equal or larger
> than the given size.
Look into java.text.MessageFormat.