rem: len = string.length; 
add: var len = string.length; 
context: function TruncateStringAtWordEnd(string, maxLength, addEllipses){  // We assume they probably don't want whitespace at the beginning  string = TrimStringLeft(string);  len = string.length;  if (len > maxLength) {    // We need to truncate the string    var max;    if (addEllipses) {      // Make room for ellipses      max = maxLength - 3;    } else {      max = maxLength;    }    var lastCharIndex = 0;        // Start search just past max if there's enough characters    if (len >= (max+1)) {      lastCharIndex = max;    } else {      lastCharIndex = len-1;    }    dump("Len="+len+" lastCharIndex="+lastCharIndex+" max="+max+"\n");    // Find the last whitespace char from the end    dump("Skip to first whitspace from end: ");    while (lastCharIndex > 0) {      lastChar = string.charAt(lastCharIndex);      dump(lastChar);      if (IsWhitespace(lastChar)) break;      lastCharIndex = lastCharIndex -1;    }    dump("[space found]\nlastCharIndex="+lastCharIndex+"\nSkip over whitespace:");    while (lastCharIndex > 0) {      // Find the last non-whitespace char      lastChar = string.charAt(lastCharIndex);      dump(lastChar);      if (!IsWhitespace(lastChar)) break;      lastCharIndex = lastCharIndex -1;    }    dump("[non-space found]\nlastCharIndex="+lastCharIndex+"\n");        string = string.slice(0, lastCharIndex+1);    if (addEllipses) {      string = string+"...";      dump(string+"\n");    }  }  return string;}
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/d54ddc36328b23f18d8ca2086a17b9f8822e393d/EdDialogCommon.js/clean/editor/ui/dialogs/content/EdDialogCommon.js