Repeat a string: Difference between revisions

Content added Content deleted
Line 339: Line 339:


=={{header|PureBasic}}==
=={{header|PureBasic}}==
<lang PureBasic>Procedure RepeatString(text.s="Default Text.",num=10)
<lang PureBasic>Procedure.s RepeatString(count, text$=" ")
Define i=num
Protected i, ret$=""
For i=0 To num
Print(text)
Next i
EndProcedure


For i = 1 To count
If OpenConsole()
ret$ + text$
RepeatString() ; Print Default Txt, default times
Next
RepeatString("New Text!"+#CRLF$) ; Print this text default times
ProcedureReturn ret$
RepeatString("** Yet a New **",3) ; Uses these parameters
EndProcedure</lang>
Input(): CloseConsole() ; Wait for a 'ENTER', then quit
EndIf </lang>


=={{header|Python}}==
=={{header|Python}}==