Exemplo n.º 1
0
        private static string Ctor(char c, int count)
        {
            if (count <= 0)
            {
                if (count == 0)
                {
                    return(Empty);
                }
                throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NegativeCount);
            }

            string result = FastAllocateString(count);

            if (c != '\0')
            {
                SpanHelpers.Fill(ref result._firstChar, (uint)count, c);
            }
            return(result);
        }