Javascript String toHiraganaCase()

Description

Javascript String toHiraganaCase()



String.prototype.toHiraganaCase = function()
{
 var c, i = this.length, a = [];

 while(i--)//from  w  ww. java 2  s .co m
 {
  c = this.charCodeAt(i);
  a[i] = (0x30A1 <= c && c <= 0x30F6) ? c - 0x0060 : c;
 };

 return String.fromCharCode.apply(null, a);
};



PreviousNext

Related