is there a str.repeat() method in Java? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

is there a str.repeat() method in Java?

ai.unitai.unit Posts: 81Member
Hi everybody!
i need to have a string repeated using a java script.. let's say i have this:

[code]
var txt = "a text "
var msg

msg = txt.repeat(2)
alert(msg)
[/code]

and i would like the output to be "a text a text", what method do i need to use in place of the repeat method? or what is the way to achieve this?

thank you very much!


just a sam7 -/-
Sign In or Register to comment.