Stay organized with collections Save and categorize content based on your preferences.

blockly > FieldDropdown > applyTrim_

FieldDropdown.applyTrim_() method

Use the calculated prefix and suffix lengths to trim all of the options in the given array.

Signature:

static applyTrim_(options: any[][], prefixLength: number, suffixLength: number): any[][];

Parameters

Parameter Type Description
options any[][] Array of option tuples: (human-readable text or image, language-neutral name).
prefixLength number The length of the common prefix.
suffixLength number The length of the common suffix

Returns:

any[][]

A new array with all of the option text trimmed.