n.c.
[chise/ruby.git] / chise / string.rb
index ee96134..929c7ca 100755 (executable)
@@ -26,14 +26,24 @@ class String
     char.method_missing(mid, *args)
   end
 
+  def to_a
+    self.split(//u)
+  end
+
+  def char_length
+    to_a.length
+  end
+
   def each_char
     to_a.each {|c|
       yield(c)
     }
   end
 
-  def to_a
-    self.split(//u)
+  def each_character
+    to_a.each {|ch|
+      yield ch.char
+    }
   end
 
   def de_er()