Contents

index(before:)

Returns the position immediately before the given index.

Declaration

func index(before index: Int) -> Int

Parameters

  • index:

    A valid index of the array. i must be greater than startIndex.

Return Value

The index immediately preceding i.

Discussion