Skip to content

Instantly share code, notes, and snippets.

@nemo-kaz
Created July 11, 2014 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nemo-kaz/a035a651ce03c83f18f2 to your computer and use it in GitHub Desktop.
Save nemo-kaz/a035a651ce03c83f18f2 to your computer and use it in GitHub Desktop.
kana2ei converter
/** メインフレームのIBM EBCDIC半角カタカナを英小文字に変換するmetaClass操作*/
// before:アイウエオカキクケタチツテトナニヌネヘホマミムメモヤ
// after: abcdefghijklmnopqrstuvwxyz
String.metaClass.kana2ei = { ->
return delegate.tr('アイウエオカキクケタチツテトナニヌネヘホマミムメモヤ','abcdefghijklmnopqrstuvwxyz')
}
assert "ネオカオネオトウオ クイ0020 オトエ-ウアツツ".kana2ei()=="reference hb0020 end-call"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment