*** empty log message ***
[m17n/m17n-lib-cs.git] / MText.cs
index 9180c62..b281808 100644 (file)
--- a/MText.cs
+++ b/MText.cs
@@ -227,6 +227,16 @@ namespace M17N.Core
 
     public override string ToString () { return sb.ToString (); }
 
+    public static implicit operator MText (string str)
+    {
+      return new MText (str);
+    }
+
+    public static explicit operator string (MText mt)
+    {
+      return mt.ToString ();
+    }
+
     private static int inc_idx (StringBuilder sb, int i)
     {
       return (i + (Char.IsHighSurrogate (sb[i]) ? 2 : 1));
@@ -462,6 +472,11 @@ namespace M17N.Core
       return this;
     }
 
+    public MText Del ()
+    {
+      return Del (0, Length);
+    }
+
     public MText Del (int from, int to)
     {
       if (check_range (from, to, true))
@@ -621,7 +636,8 @@ namespace M17N.Core
 
     public object FindProp (MSymbol key, int pos, out int from, out int to)
     {
-      from = to = pos;
+      from = 0;
+      to = Length;
       check_pos (pos, false);
       
       MInterval i = (MInterval) intervals.Get (key);