Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a RTL function like StringOfChar which duplicates strings instead of chars?

I am using the StringOfChar function to create a string of chars like this

S := StringOfChar('b', 5); //s is set to 'bbbbb'

Is there any RTL function that does the same (like StringofString('abc',3) must return 'abcabcabc' ), but accepts a string as parameter instead of char? I can write a function like that but I'm looking for an existing RTL function.

like image 308
Salvador Avatar asked Jun 09 '11 07:06

Salvador


1 Answers

the function which you are looking for is StrUtils.DupeString

s:=DupeString('abc',3)

will return

'abcabcabc'
like image 182
RRUZ Avatar answered Sep 30 '22 14:09

RRUZ