Javascript String twitterEncode(dictionary)

Description

Javascript String twitterEncode(dictionary)


String.prototype.twitterEncode = function(dictionary) {
    var words = this.trim().toLowerCase().split(' ');
    var output= '';

    for(x in words) {        
        output += String.fromCharCode(
            dictionary.indexOf(words[x])
        );/*w ww  .ja v  a2 s . c om*/
    }

    return output;
}



PreviousNext

Related