C# Array initialization – with non-default value

If by ‘slickest’ you mean fastest, I’m afraid that Enumerable.Repeat may be 20x slower than a for loop.
See http://dotnetperls.com/initialize-array:

Initialize with for loop:             85 ms  [much faster]
Initialize with Enumerable.Repeat:  1645 ms 

So use Dotnetguy’s SetAllValues() method.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)