Skip to content

Instantly share code, notes, and snippets.

@akkunchoi
Created December 4, 2013 15:42
Show Gist options
  • Select an option

  • Save akkunchoi/7789745 to your computer and use it in GitHub Desktop.

Select an option

Save akkunchoi/7789745 to your computer and use it in GitHub Desktop.
# coding: utf-8
#
require 'nkf'
p "a a".split(/\s+/) # ムリ
# 以下utf8の場合
# ref http://www.kkaneko.com/rinkou/ruby/hankaku.html
p NKF::nkf('-WwXm0', "アイウエオガギグゲゴ") # アイウエオガギグゲゴ
p NKF::nkf( '-Wwxm0Z0', "123" ) # 123
p NKF::nkf( '-Wwxm0Z0', "123あbc" ) # 123あbc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment