﻿

    // #region String Prototyping
    // **************************

        String.empty = "";

        String.isNullOrEmpty = function (value)
        {
            var _this = this;
            try
            {
                return value == null || value == String.empty;
            }
            finally
            {
                _this = null;
            }
        };

        String.prototype.trim = function ()
        {
            var _this = this;
            try
            {
                return _this.replace(/^\s+|\s+$/g, "");
            }
            finally
            {
                _this = null;
            }
        };

        String.prototype.padLeft = function (length, character)
        {
            var _this = this;
            try
            {
                while (_this.length < length)
                    _this = character + _this;
                return _this;
            }
            finally
            {
                _this = null;
            }
        };

        String.prototype.padRight = function (length, character)
        {
            var _this = this;
            try
            {
                while (_this.length < length)
                    _this = _this + character;
                return _this;
            }
            finally
            {
                _this = null;
            }
        };

    // #endregion
