Beispiel #1
0
        public void SpanWithOffsetToString()
        {
            var s     = "olé";
            var bytes = Encoding.UTF8.GetBytes("zz" + s + "!");
            var span  = new Utf8ByteSpan(bytes, 2, bytes.Length - 3);

            Assert.Equal(s, span.GetString());
        }
Beispiel #2
0
        public void SpanToString()
        {
            var s     = "olé";
            var bytes = Encoding.UTF8.GetBytes(s);
            var span  = new Utf8ByteSpan(bytes, 0, bytes.Length);

            Assert.Equal(s, span.GetString());
        }