码迷,mamicode.com
首页 > 编程语言 > 详细

repeat a string in java

时间:2014-09-10 19:15:20      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   java   ar   div   sp   log   c   

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

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

 

repeat a string in java

标签:style   blog   color   java   ar   div   sp   log   c   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!