<script type="text/javascript"> <!-- String.prototype.toChar_8 = function() { return this.replace(/[A-Za-z0-9]/g, function(s) { return String.fromCharCode(s.charCodeAt(0) - 0xFEE0); }); } var text = "Abc012"; document.write(text + "<br>"); document.write(text.toChar_8()); // --> </script><br> |
String.prototype.toChar_8 = function() { return this.replace(/[A-Za-z0-9]/g, function(s) { return String.fromCharCode(s.charCodeAt(0) - 0xFEE0); }); } |
<script type="text/javascript"> <!-- String.prototype.toChar_16 = function() { return this.replace(/[A-Za-z0-9]/g, function(s) { return String.fromCharCode(s.charCodeAt(0) + 0xFEE0); }); } var text = "Xyz789"; document.write(text + "<br>"); document.write(text.toChar_16()); // --> </script><br> |
String.prototype.toChar_16 = function() { return this.replace(/[A-Za-z0-9]/g, function(s) { return String.fromCharCode(s.charCodeAt(0) + 0xFEE0); }); } |
<script type="text/javascript"> function toChar_8(s) { return s.replace(/[A-Za-z0-9]/g, function(s) { return String.fromCharCode(s.charCodeAt(0) - 0xFEE0); }); } var text = "Abc012"; document.write(text + "<br>"); document.write(toChar_8(text)); </script><br> |