X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=mtext.cs;h=bc8dad5b4ada9de8e36e3322806f2096249f6573;hb=ddaf242f412b3aedd301517435f1f05f27df7182;hp=5610dbdfa56a83b9c31de6fcade396fd08579293;hpb=ac10578a8f79c6df14642725ef6ddae79bc7d2a6;p=m17n%2Fm17n-lib-cs.git diff --git a/mtext.cs b/mtext.cs index 5610dbd..bc8dad5 100644 --- a/mtext.cs +++ b/mtext.cs @@ -20,5 +20,20 @@ public class Test foreach (int c in mt) Console.WriteLine ("U+{0:X4}", c); Console.WriteLine (mt + new MText ("漢字")); + Console.WriteLine (mt[2,4]); + mt[0] = '日'; // == mt.Del (0, 1); mt.Ins (0, char) + Console.WriteLine (mt); + mt[1,3] = new MText ('本'); // == mt.Del (1, 3); mt.Ins (1, mt) + Console.WriteLine (mt); + mt[1,2] = null; // == mt.Del (1, 2) + Console.WriteLine (mt); + // explicit casting (MText -> string) + string str2 = " " + (string) mt + (string) ((MText) "abc").Cat ('a'); + Console.WriteLine (str2); + // implicit casting (string -> MText) + mt2 = "abc"; + mt2.Cat ("def"); + mt2 += "ghi"; + Console.WriteLine (mt2); } }