给数组中的每个元素赋值

public static T[] SetAllValues<T>(this T[] array, T value)
{
    for ( int i=0; i<array.Length;i++)  
    {
          array[i]=value;
     }   
  return array; }

 

posted @ 2015-07-21 09:20  Coding_Yong  阅读(1951)  评论(0编辑  收藏  举报