Constructs and initializes a new instance of string .
Type Reason ArgumentOutOfRangeException count is less than zero.
If the specified number is 0, string.Empty is created.
The following example demonstrates using this constructor.
C# Example
using System; public class StringExample { public static void Main() { string s = new String('a', 10); Console.WriteLine(s); } }The output is
aaaaaaaaaa
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0