Javascript String toKatakanaCase()

Description

Javascript String toKatakanaCase()



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

 while(i--)/* w w w . jav  a 2 s  . c o  m*/
 {
  c = this.charCodeAt(i);
  a[i] = (0x3041 <= c && c <= 0x3096) ? c + 0x0060 : c;
 };

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



PreviousNext

Related