I want to create a static ReadOnlyCollection with strings.
Is there any way to make this expression shorter or more elegant in some way?
public static readonly ReadOnlyCollection<string> ErrorList = new ReadOnlyCollection<string>(
new string[] {
"string1",
"string2",
"string3",
}
);
I use this many times, but in different files.
1 Answer