in reply to Re^4: Replace consecutive whitespaces with single whitespace
in thread Replace consecutive whitespaces with single whitespace
As your benchmark shows, the overhead for the operation is less than a factor of 2. This is extremely unlikely to be a make or break performance issue. There are plenty of other operations you are likely to do with the string that have an even larger overhead. (For example reading it in or printing it.)
Unless performance has proven to be an issue and this is where performance was lost, I remain unconcerned.
|
|---|