sK()

What does sK() do?

sK() selects the first K elements in an array/string inside of it. It can be combined with oK() to get any range of values in a string/array

from ArrayExpressions import arrex
lst = [1, 2, 3, 4, 5]
output = arrex.evaluate(lst, 's3(x)')
print(output) # [1, 2, 3]

Other Important Information:

InputAny array or string
Does it create a new scope?No
OutputAn array of the first K values
KAny number
IThe K value
Examples3("Hello")
Example ExplanationThis returns "Hel" because those are the first 3 characters in the string

oK()

iK()