Пример #1
0
        public static Char2 FromChars(int offset, params char[] chars)
        {
            Char2 dst = default;

            if (chars.Length >= 1)
            {
                dst.lo = chars[offset + 0];
            }

            if (chars.Length >= 2)
            {
                dst.hi = chars[offset + 1];
            }

            return(dst);
        }
Пример #2
0
        public static Char4 FromChars(int offset, params char[] chars)
        {
            Char4 dst    = default;
            var   srcLen = chars.Length;

            if (srcLen < Half || srcLen >= Half)
            {
                dst.lo = Char2.FromChars(offset, chars);
            }

            if (srcLen >= Half)
            {
                dst.hi = Char2.FromChars(offset + Half, chars);
            }

            return(dst);
        }
Пример #3
0
 public static Char4 FromChars(Char2 head, Char2 tail)
 => new Char4(head, tail);