morelinq / MoreLINQ

Extensions to LINQ to Objects
https://morelinq.github.io/
Apache License 2.0
3.63k stars 409 forks source link

[Proposal] Trim Extension #998

Closed jamkin closed 1 year ago

jamkin commented 1 year ago

This is an incomplete PR to propose a new extension method Trim. The same can be achieved with an inefficient combination of SkipWhile, Skip, Reverse and Count. This is more flexible and efficient. It can also provide a more efficient way than the commonly used .Trim method for strings, which has to allocate a whole new string.

Looking for any feedback before adding tests, generating the public/shipped API and so forth.

atifaziz commented 1 year ago

I'm going to assume that this has been abandoned based on my earlier comment, but happy to re-open if there's follow-up and arguments for pursuing this further.