| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Creates a character string by replicating an input string.
Replicate( <cString>, <nCount> ) --> cReplicatedString
The function returns a character string holding the input string <cString> <nCount> number of times.
Replicate() provides a convenient way for creating an output string consisting of multiple copies of an input string.
A similar function is Space() which creates a character string consisting of blank space characters only.
| See also: | PadC() | PadL() | PadR(), Space() |
| Category: | Character functions |
| Source: | rtl\replic.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example shows results of Replicate()
PROCEDURE Main
? Replicate( "-", 17 ) // result: -----------------
? Replicate( "xHarbour ", 2 ) // result: xHarbour xHarbour
? Replicate( "!", 17 ) // result: !!!!!!!!!!!!!!!!!
RETURN
http://www.xHarbour.com