System.Strings.GetValues C# (CSharp) Method

GetValues() public static method

public static GetValues ( int count, Type type = Type.All ) : List
count int
type Type
return List
            public static List<string> GetValues(int count, Type type = Type.All)
            {
                var values = GetValues(type);
                if (values.Count == count) return values;
                else if (values.Count > count) return values.OrderBy(x => Guid.NewGuid()).Take(count).ToList();
                else
                {
                    var add_count = count - values.Count;
                    var list = values.ToList();
                    for (int i = 0; i < add_count; i++)
                    {
                        list.Add(values[Random2.Next(values.Count)]);
                    }
                    return list;
                }
            }

Same methods

Strings::GetValues ( Type type = Type.All ) : List
Strings