IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.0
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

slice

slice(end: Int) -> Slice

Construct slice given the end value.

Args:

  • end (Int): The end value.

Returns:

Slice: The constructed slice.

slice(start: Int, end: Int) -> Slice

Construct slice given the start and end values.

Args:

  • start (Int): The start value.
  • end (Int): The end value.

Returns:

Slice: The constructed slice.

slice(start: Optional[Int], end: Optional[Int], step: Optional[Int]) -> Slice

Construct a Slice given the start, end and step values.

Args:

Returns:

Slice: The constructed slice.