package com.afi.estimator.util
{
    import mx.utils.StringUtil;

    public class StrUtil
    {
        /**
         * Works like Adobe's isWhiteSpace utility method,
         * except using trim to deal with full strings
         */
        public static function isWhiteSpace(str:String):Boolean {
            return mx.utils.StringUtil.trim(str) == "";
        }
        
        /**
         * Returns true if each Strings in the Array is white space
         */
        public static function strArrayIsWhiteSpace(arr:Array):Boolean {
            var result:Boolean = true;
            
            arr.map(function(str:String, ...rest):void {
                if(!isWhiteSpace(str)) {
                    result = false;
                } 
            });
            
            return result;
        }
    }
}