¡@

Home 

java Programming Glossary: stringutils.center

How to center a string using String.format?

http://stackoverflow.com/questions/8154366/how-to-center-a-string-using-string-format

this question I quickly hacked this up. You can now use StringUtils.center String s int size in String.format . import static org.hamcrest.CoreMatchers.equalTo.. TestCenter @Test public void centersString assertThat StringUtils.center null 0 equalTo null assertThat StringUtils.center foo 3 is foo.. StringUtils.center null 0 equalTo null assertThat StringUtils.center foo 3 is foo assertThat StringUtils.center foo 1 is foo assertThat..