3 ms·
What would be a practical application of this? The linked post mentions a trim like operation, but in practice I only want to remove white space from the ends,
by tedunangst 5y ago
What would be a practical application of this? The linked post mentions a trim like operation, but in practice I only want to remove white space from the ends, not the interior of the string, and finding the ends is basically the whole problem. Or maybe I want to compress some json, but a simple approach won't work because there can be spaces inside string values which must be preserved.
- jandrewrogers 5y agoI agree that the whitespace in text example seems a bit contrived but I've done similar types of byte elision operations on binary streams (e.g. for compression purposes), which this could be trivially adapted to.