September, 2012

A collection of simple AS3 string helpers

This article was originally published at

We all know that it’s smart to create helper and utility classes when faced with a problem that can be encapsulated, but sometimes we forget that even the smallest of things can be put into a helper. Whenever you find yourself writing something more than once you should think about encapsulating that logic. Even small logical elements should be moved to a separate function. It helps with readability, maintainability, and a separation of logic. It also makes things easier to test. Here are a couple of ActionScript string utilities we use. We have tons of them and I’ll be posting snippets here and there of ones we find useful.

Check if a list is empty.

I use this one everywhere! It seems silly, but this may be the most used helper function in our entire application.

public static function isEmpty(list:IList):Boolean {
    return list 
Read more