Javascript String parseUser()

Description

Javascript String parseUser()

String.prototype.parseUser = function() {
 return this.replace(/[@]+[A-Za-z0-9-_]+/g, function(u) {
  var username = u.replace("@","")
  return u.link("https://twitter.com/intent/user?screen_name="+username);
 });/*from  w ww  .j  ava2  s .  co m*/
};

Javascript String parseUsername()

String.prototype.parseUsername = function() {
  return this.replace(/[@]+[A-Za-z0-9-_]+/g, function(u) {
    var username = u.replace("@","")
    return u.link("http://twitter.com/"+username);
  });//www  .j  av  a2s .c  o m
};



PreviousNext

Related