コード例 #1
0
        public void CopyToTest()
        {
            using NativeString str = new NativeString("Hello".AsSpan());
            Span <char> span = stackalloc char[5];

            str.CopyTo(span, 0, 5);
            Assert.AreEqual('H', span[0]);
            Assert.AreEqual('e', span[1]);
            Assert.AreEqual('l', span[2]);
            Assert.AreEqual('l', span[3]);
            Assert.AreEqual('o', span[4]);
        }