repeat a string in java

时间:2014-09-10 19:15:21   收藏:0   阅读:265

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

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

 

原文:http://www.cnblogs.com/miaoz/p/3964941.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!