Convert Array Type - CSharp System

CSharp examples for System:Array Convert

Description

Convert Array Type

Demo Code


using System.Collections.Generic;
using System;/* ww w . ja  v  a  2s .  c o  m*/

public class Main{
        internal static S[] ConvertArrayType<R, S> (ICollection<R> src, Func<R, S> f)
        {
            if (src == null) {
                return null;
            }
            int count = src.Count;
            int num2 = 0;
            S[] localArray = new S[count];
            foreach (R local in src) {
                localArray[num2++] = f(local);
            }
            return localArray;
        }
}

Related Tutorials