Login  Register

Re: Extension of the IJ.pad method

Posted by Gabriel Landini on Jun 12, 2020; 11:06am
URL: http://imagej.273.s1.nabble.com/Extension-of-the-IJ-pad-method-tp5023507p5023508.html

Hi, would this help?:
https://stackoverflow.com/questions/388461/how-can-i-pad-a-string-in-java
You use String.format() and then the replace method.

Cheers

Gabriel

On Friday, 12 June 2020 11:43:17 BST [hidden email] wrote:
> Dear all,
> Would it be of common interest to have a IJ.pad(n, length, str) method which
> would able to pad whatever string (i.e. not only zeros)? Actually in my
> application, I would need to pad spaces (i.e. having str = " "). I thank
> you very much for your lighting on this.
> My best regards,
> Philippe

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html