Apache Commons Lang (probably useful enough to be on the classpath of any non-trivial project) has StringUtils.repeat():
String filled = StringUtils.repeat("*", 10);
Read full article from Java - Create a new String instance with specified length and filled with specific character. Best solution? - Stack Overflow
No comments:
Post a Comment