Add StringSplitOptions.TrimEntries by GrabYourPitchforks · Pull Request #35740 · dotnet/runtime (original) (raw)

I still need to investigate why some unit tests are failing. The report says that 19 failures occurred, but every test is marked "Pass". So that's fun. :D

I didn't perf test this but I don't anticipate much perf impact. The related PR #35733 should slightly improve perf in the RemoveEmptyEntries case since it more efficiently resizes the final returned array.

Separately, I was experimenting with a design that removes the intermediate array entirely. That should result in less GC pressure in the RemoveEmptyEntries case. But since it introduces some level of complexity and isn't a visible behavioral change I thought it best to reserve that improvement for a different PR.