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.
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.
This is an incomplete PR to propose a new extension method
Trim
. The same can be achieved with an inefficient combination ofSkipWhile
,Skip
,Reverse
andCount
. This is more flexible and efficient. It can also provide a more efficient way than the commonly used.Trim
method forstring
s, which has to allocate a whole new string.Looking for any feedback before adding tests, generating the public/shipped API and so forth.