Solana DocumentationSurfpoolInfrastructure as CodeStandard Library

List Functions

index

index gets the entry from a list at the specified index.

Inputs

NameTypeDescription
listarray[string] | array[integer] | array[buffer]The list to retrieve an entry from
indexintegerThe index of the entry to retrieve

Output

NameTypeDescription
valuestringThe entry from list at the specified index
output "entry" {
value = index(['a', 'b', 'c'], 1)
}
// > entry: b

Is this page helpful?

Table of Contents

Edit Page
© 2026 Solana Foundation. All rights reserved.