blockly > utils > string > commonWordSuffix

utils.string.commonWordSuffix() function

Given an array of strings, return the length of the common suffix. Words may not be split. Any space after a word is included in the length.

Signature:

export declare function commonWordSuffix(array: string[], opt_shortest?: number): number;

Parameters

Parameter Type Description
array string[] Array of strings.
opt_shortest number (Optional) Length of shortest string.

Returns:

number

Length of common suffix.