Skip to content

Implement GetSlice #16

Description

@xperiandri

Like

[<Extension>]
type SliceExtensions =

    [<Extension>]
    static member GetSlice(source: FlatList<'t>, from: int option, ``to``: int option) =
        let from = from |> Option.defaultValue 0
        let ``to`` = ``to`` |> Option.defaultValue source.Length
        source
        |> Seq.skip from
        |> Seq.take (``to`` - from + 1)
        |> Seq.toFlatList

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions