Andrej Mitrovic Wrote:

>     char[] replacement;
>     foreach (char[] line; file.byLine())
>     {
>         replacement = line.replace(regex("->"), ".")
>                                   .replace(regex("::"), ".")
>                                   .replace(regex("//.*"), "")
>                                   .replace(regex("\\*"), "");
>        // do something with replacement while its still alive..
>     }
> 
> How would I go about achieving this?
> And if I use strings instead isn't this going to involve a lot of duplication?

Replace should probably work with char[], but not for efficiency. Unless I am 
wrong you will still cause a large amount of copying when replacing a 
single/multiple string with a multiple/single string. You may avoid 
re-allocation, but even that isn't guarantied.

Reply via email to