leftForList

Modified on Fri, 18 Aug 2023

Description

Return a specified number of characters from the beginning of each string in a list

Syntax

leftForList(array, length)

Parameters

Input ParameterTypeDescription
arrayArrayThe list of input strings
lengthnumberThe number of characters to return from the beginning

Return value

Type
Array<any>

Sample

ExampleResultDescription
leftForList(["abcd", "ab", ""], 3)["abc", "ab", ""]An array containing substrings with the leftmost characters from each input string

To view all the List functions, click here.

See Also