S
sln
I've read the docs on substr many a times but I still am not
quite clear on if being used as a lvalue or the replacement parameter.
I have a possible quite large string (could be megabytes).
I wan't to insert, possible in the middle a replacement text.
I'm running through an itteration on the string throught sub's etc.
Apart from like, copy from the start of a matched position, to a
file (as opposed to another buffer), then catenating the modification
to the file, then continue on with the next match, is the substr
(lvalue or replacement) a viable option?
I have to consider performance on such large operations.
What do you think would be the performance 'hit' if modifying
the string in-place using substr as either an lvalue or replacement?
There has to be some memcpy()'s or moves involved.
If replacement based, I can adjust the pos() for the next match,
but to insert even a little change in string size, in the middle
of a very large string could be a big performance hit?
All help is appretiated!
TIA
sln
quite clear on if being used as a lvalue or the replacement parameter.
I have a possible quite large string (could be megabytes).
I wan't to insert, possible in the middle a replacement text.
I'm running through an itteration on the string throught sub's etc.
Apart from like, copy from the start of a matched position, to a
file (as opposed to another buffer), then catenating the modification
to the file, then continue on with the next match, is the substr
(lvalue or replacement) a viable option?
I have to consider performance on such large operations.
What do you think would be the performance 'hit' if modifying
the string in-place using substr as either an lvalue or replacement?
There has to be some memcpy()'s or moves involved.
If replacement based, I can adjust the pos() for the next match,
but to insert even a little change in string size, in the middle
of a very large string could be a big performance hit?
All help is appretiated!
TIA
sln