-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add slicing of sequences via System.Range #748
Labels
Comments
There is also a proposal from @Dixin to add something like this to .NET eventually. See dotnet/runtime#28776. |
atifaziz
changed the title
Add slicing sequences via System.Range
Add slicing of sequences via System.Range
May 15, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I propose to add a new
Elements
extension that acceptsSystem.Range
and which will allow usage of the range operator..
in C# to succinctly express slicing with start and end offsets.We already have
Slice
, which is why I propose to call this extensionElements
. An overload ofSlice
would be confusing since it takes a count as the second argument as opposed to an index.Prototype
Examples
Output:
The text was updated successfully, but these errors were encountered: