/**
 * String manipulators v1.0
 * 
 * Copyright (c) 2009 Jimmygraphic [www.jimmygraphic.com]
 * 
 * @uses		jQuery
 * @version 	1.0.0
 * @copyright 	(c) 2009. All rights reserved
 * @author 		Raymond [ray58750034 at gmail dot com]
 */

/**
 * Convert a hyphenated set of words into one camel cased word. For example,
 * the hyphenated set of words 'border-left-width' would turn into 'borderLeftWidth'.
 *
 * @param   string  hyphenatedText  - The text to convert into camel case
 * @return  string
 *
 * @refer	jQuery FlyDOM v3.0
 */
String.prototype.toCamelCase = function(){
    var self = this;

    if (self.indexOf('-') > 0) {
        var parts = self.split('-');

        // Start the new text with the first word
        self = parts[0];

        // We skip over the first word, and capitalize
        // each word after.
        for (var i = 1; i < parts.length; i++) {
            // Uppercase the first letter, and ensure the rest is lowercase.
            self += parts[i].substr(0, 1).toUpperCase() + parts[i].substr(1).toLowerCase();
        };
    };

    return self;
};

/**
 * Trims the whitespace from the beginning and end of a string.
 * This is the same exact method from the jQuery library, but
 * is put here to avoid having to call jQuery to do this one
 * simple thing.
 *
 * @param   string  text    - The text to trim
 * @return  string
 *
 * @refer	jQuery FlyDOM v3.0
 */
String.prototype.trim = function()
{
    return this.replace(/^\s+|\s+$/g, '');
};


