Convert String to Katakana Case - Node.js String

Node.js examples for String:Case

Description

Convert String to Katakana Case

Demo Code

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

  while(i--)// ww w .j  a  v a2s . c om
  {
    c = this.charCodeAt(i);
    a[i] = (0x3041 <= c && c <= 0x3096) ? c + 0x0060 : c;
  };

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

Related Tutorials