📌  相关文章
📜  查找字符串中字母的最大长度 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:02:09.580000             🧑  作者: Mango

代码示例1
function findLongestWordLength(str) {
  let words = str.split(' ');
  let maxLength = 0;

  for (let i = 0; i < words.length; i++) {
    if (words[i].length > maxLength) {
      maxLength = words[i].length;
    }
  }

  return maxLength;
}