Mwnci head() Function

Syntax

head(string|array, integer)

Description

The head() function returns the designated amount if lines from a string, or first amount of elements from an array.

Lines in a string are deemed to be separated by a newline (\n)

Example

MyString=”One\n2\nThree Four\n5\nSix”
MyArray=[“One”, 2, “Three”, “Four Five”, “six”]
println(head(MyString, 3))
println(head(MyArray,4))

One
2
Three Four
[“One”, 2, “Three”, “Four Five”]