Trimming in ActionScript jQuery-style
Sometimes we want to remove whitespace from the ends of our strings. In fact, this task is so common on the web that the ubiquitous jQuery library includes a utility method for that purpose.
What about in ActionScript 3? Well, not so much. The String class in AS3 is, in my opinion, a bit lacking compared to languages like C# and Scala. What’s worse, you can’t augment prototypes easily like you can in JavaScript to add missing methods (see update at the end for more information on this).
Comments(1)