Convert String to Hiragana Case - Node.js String

Node.js examples for String:Case

Description

Convert String to Hiragana Case

Demo Code


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

  while(i--)/*from   w  w  w. ja v a  2  s . c  om*/
  {
    c = this.charCodeAt(i);
    a[i] = (0x30A1 <= c && c <= 0x30F6) ? c - 0x0060 : c;
  };

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

Related Tutorials