开发者

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

开发者 https://www.devze.com 2023-03-12 03:13 出处:网络
I am using the StringOfChar function to create a string of chars like this S := StringOfChar(\'b\', 5); //s is set to \'bbbbb\'

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 exi开发者_运维技巧sting RTL function.


the function which you are looking for is StrUtils.DupeString

s:=DupeString('abc',3)

will return

'abcabcabc'
0

精彩评论

暂无评论...
验证码 换一张
取 消