Fills the array with the specified value. - CSharp System

CSharp examples for System:Array Operation

Description

Fills the array with the specified value.

Demo Code


using System;/*from   w  ww.ja  va2 s . c  o m*/

public class Main{
        /// <summary>
        /// Fills the array with the specified value.
        /// </summary>
        /// <param name="array">The array to fill.</param>
        /// <param name="value">The value.</param>
        public static void Fill(this double[] array, double value)
        {
            for (var i = 0; i < array.Length; i++)
            {
                array[i] = value;
            }
        }
}

Related Tutorials