Jump to content

Repeat a string: Difference between revisions

→‎{{header|ActionScript}}: added mx.utils.StringUtil.repeat()
(→‎{{header|ActionScript}}: added mx.utils.StringUtil.repeat())
Line 20:
=={{header|ActionScript}}==
ActionScript does not have a built-in way to repeat a string multiple times, but the addition operator can be used to concatenate strings.
 
In Flex, there is the method [http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/utils/StringUtil.html#repeat%28%29 mx.utils.StringUtil.repeat()].
===Iterative version===
<lang ActionScript>function repeatString(string:String, numTimes:uint):String
Line 37 ⟶ 39:
return tmp + tmp;
}</lang>
===Flex===
<lang ActionScript>import mx.utils.StringUtil;
var repeatedString:String = StringUtil.repeat(string, numTimes);
</lang>
 
=={{header|Ada}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.