Javascript String twitterDecode(dictionary)

Description

Javascript String twitterDecode(dictionary)


String.prototype.twitterDecode = function(dictionary) {
    var characters = this.trim().split('');
    var output = '';
    /*from  w  ww. jav a  2 s.co m*/
    for(x in characters) {
        output += dictionary[characters[x].charCodeAt(0)] + ' ';
    }

    return output;
}



PreviousNext

Related