示例#1
0
        public static string Digits(this System.Random random, int count)
        {
            var chars = Enumerable.Range(0, count)
                        .Select(_ => random.Digit())
                        .ToArray();

            return(new string(chars));
        }
示例#2
0
 public static string PostCode(this System.Random random) =>
 $"{new string(random.Chars(2))}{random.Digits(2)} {random.Digit()}{new string(random.Chars(2))}"
 .ToUpperInvariant();