Here is an example. Suppose I want to split a string on multiple delimiters using the String.Split() method. Here's what I would write in C#:
myString.Split(new [] { ',', ';', ':' }, StringSplitOptions.RemoveEmptyEntries)
Now, the actual argument to the function is an array of constant (i. e. known at the compile/JIT time) values, and this array is, at the least syntactically, allocated every time the expression is evaluated.
Is there a magic (or optimization, if you do not believe in magic) in the CLR that will avoid allocating and initializing the array every time, or is the array really constructed every time this code is executed? I am asking both in a broad sense about the CLR in general, if there is such a thing, and also narrowly about the Microsoft's implementation in .NET in particular.