Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home5/programz/hyperbytelabs.com/wp-content/plugins/revslider/includes/operations.class.php on line 2715

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home5/programz/hyperbytelabs.com/wp-content/plugins/revslider/includes/operations.class.php on line 2719

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home5/programz/hyperbytelabs.com/wp-content/plugins/revslider/includes/output.class.php on line 3615
JavaScript StartsWith / EndsWith - Hyper Byte Labs

JavaScript StartsWith / EndsWith

IsNullOrEmpty function for all objects

C# IsNullOrEmpty for all objects

    This will test for IsNullOrEmpty for all objects including string and you can specify multiple values including multiple types.  E.g. “”, null, -1 as a prarms based object or array

    public static bool IsNullOrEmpty(object obj, params object[] emptyValues)
    {
        object[] defaultEmptyValues = new object[] { "", null, -1 };
    
        if (emptyValues == null)
        {
            emptyValues = defaultEmptyValues;
        }
        foreach (object emptyValue in emptyValues)
        {
            if (obj == emptyValue) return true;
        }
        return false;
    
    }