repeat a string in java

if I want to repeat "hello" four times as a new string-> "hellohellohellohello". I can:

return new String(new char[4]).replace("\0", "hello")

 

posted @ 2014-09-10 17:59  zmiao  阅读(487)  评论(0编辑  收藏  举报