}
else
{
- char high = (char) (0xD800 + ((i - 0x10000) >> 10));
- char low = (char) (0xDC00 + ((i - 0x10000) & 0x3FF));
+ char high = (char) (0xD800 + ((value - 0x10000) >> 10));
+ char low = (char) (0xDC00 + ((value - 0x10000) & 0x3FF));
if (! surrogate_high_p (sb[i]))
sb.Insert (i, 0);
- sb[i++] = high;
- sb[i] = low;
+ sb[i] = high;
+ sb[i + 1] = low;
}
}
get {
i = pos_to_idx (this, i);
return (surrogate_high_p (sb[i])
- ? i = ((sb[i] - 0xD800) << 10) + (sb[i + 1] - 0xDC00) + 0x10000
+ ? ((sb[i] - 0xD800) << 10) + (sb[i + 1] - 0xDC00) + 0x10000
: sb[i]);
}
}
public MText dup ()
{
- return (new MText (this.sb));
+ return (new MText (sb.ToString ()));
}
public MText ins (int pos, ref MText mt)
public static void Main()
{
MText mt = new MText ("a𝄀あc");
+ MText mt2;
Console.WriteLine (mt[0]);
Console.WriteLine (mt[1]);
Console.WriteLine (mt[2]);
Console.WriteLine (mt[3]);
Console.WriteLine (mt + new MText ("漢字"));
+ mt2 = mt.dup ();
mt[1] = 'b';
- Console.WriteLine (mt);
- mt[1] = 0x1d100;
- Console.WriteLine (mt);
+ Console.WriteLine (mt2);
+
+ Array ary = Array.CreateInstance (typeof (int32), 1, 2, 3);
+
+ Array.ForEach (ary, { Console.WriteLine (obj); });
+
}
}