Skip to main content
Log in

Mojo function

slice

slice(end: Int) -> Slice

Construct slice given the end value.

Args:

  • end (Int): The end value.

Returns:

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:

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:

  • start (Optional[Int]): The start value.
  • end (Optional[Int]): The end value.
  • step (Optional[Int]): The step value.

Returns:

The constructed slice.