blockly > utils > string

utils.string 命名空間

函式

函式 說明
commonWordPrefix(array, opt_shortest) 根據字串陣列,傳回常見前置字串的長度。字詞不可分割。字詞後方的任何空格都包含在長度中。
commonWordSuffix(array, opt_shortest) 如果有字串陣列,請傳回常見後置字串的長度。字詞不可分割。字詞後方的任何空格都包含在長度中。
isNumber(str) 指定字串是否為數字 (包括負數和小數)。
shortestStringLength(array) 針對字串陣列,傳回最短 1 的長度。
startsWith(str, prefix) 快速前置字串檢查工具。從 Closure 的 goog.string.startsWith
wrap(text, limit) 將文字截斷至指定的寬度。