lib/muflax/string.rb in muflax-0.3.21 vs lib/muflax/string.rb in muflax-0.3.22
- old
+ new
@@ -64,6 +64,13 @@
end
def color name
HighLine.color(self, name)
end
+
+ HALFWIDTH_KANA = "。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚"
+ FULLWIDTH_KANA = "。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゛゜"
+
+ def fullwidth
+ tr(" !-~" + HALFWIDTH_KANA, "\u3000" + (0xFF01...0xFF5f).to_a.pack('U*') + FULLWIDTH_KANA)
+ end
end