View Single Post
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 05-17-2018 , 15:02   Re: Place a char before every char
Reply With Quote #3

If you're going to loop over all the characters of the input, you don't want to Format every time. You only need to do two character assignments as you go along: out[i * 2] = separator and out[i * 2 + 1] = input[i].

Also, Format is able to use the same buffer for both input and output.

Last edited by Fyren; 05-17-2018 at 15:03.
Fyren is offline