Skip to main content

blockly > utils > string

utils.string namespace

Functions

Function

Description

commonWordPrefix(array, opt_shortest)

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

commonWordSuffix(array, opt_shortest)

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.

isNumber(str)

Is the given string a number (includes negative and decimals).

shortestStringLength(array)

Given an array of strings, return the length of the shortest one.

wrap(text, limit)

Wrap text to the specified width.