Skip to content

Instantly share code, notes, and snippets.

@nyawach
Last active June 13, 2018 11:19
Show Gist options
  • Save nyawach/e3216d4e5bd2e020d813318f45960e8a to your computer and use it in GitHub Desktop.
Save nyawach/e3216d4e5bd2e020d813318f45960e8a to your computer and use it in GitHub Desktop.
hira2kata.js
function hira2kata(str) {
return str.replace(/[\u3041-\u3096]/g, (match) => {
const chr = match.charCodeAt(0) + 0x60;
return String.fromCharCode(chr);
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment