Javascript String firstNotSpaceChar()

Description

Javascript String firstNotSpaceChar()


String.prototype.firstNotSpaceChar=function(){     
  var rgx = /^\s*(\S)/;
  var rlt = rgx.exec(this);
  if(rlt){/*from  w w  w .  ja va2  s. co m*/
    return rlt[1];
  }
  return rlt;
}



PreviousNext

Related