Repeat / dupplicate a string

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Olli
Addict
Addict
Posts: 1200
Joined: Wed May 27, 2020 12:26 pm

Re: Repeat / dupplicate a string

Post by Olli »

Little John wrote:By the way ... In case you just want to repeat 1 character you can use the following, which is very fast:

Code: Select all

Macro RepeatChar (_count_, _char_)
   LSet("", _count_, _char_)
EndMacro
Very good too. Fred have had a period when he optimized the string library. Thank you for these efficient recalls. :)
Post Reply