Revision: 11585
Updated Code
at February 11, 2009 14:35 by cessnajumpin
Updated Code
private function ellipsed(fullString:String, cutOff:Number):String { if(fullString.length < cutOff) { return fullString; } else { var ellipsedString:String = fullString.substr(0, (cutOff - 3)); ellipsedString += "..."; } return ellipsedString; }
Revision: 11584
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at February 10, 2009 12:46 by cessnajumpin
Initial Code
private function ellipsed(fullString:String, cutOff:Number):String { if(fullString.length > cutOff) { var ellipsedString:String = fullString.substr(0, (cutOff - 3)); ellipsedString += "..."; } else { ellipsedString = fullString; } return ellipsedString; }
Initial URL
Initial Description
Extremely simple... just pass in the string you want to ellipse, and the position you want to do it at. The code takes care of the rest.
Initial Title
Simply Ellipse Long Strings
Initial Tags
text
Initial Language
ActionScript 3