Cast to int in CSharp

Description

The following code shows how to cast to int.

Example


using System;/*w w w.  jav a2s .c om*/
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;

public class MainClass
{
    public static void Main(){
            object[] doubles = {1.0, 2.0, 3.0};
            IEnumerable<int> dValues = doubles.Cast<int>();
            foreach(var d in dValues){
               Console.Write(d);
            }
            
   }
}




















Home »
  C# Tutorial »
    LINQ »




Operator
Select
Where
OrderBy
Group
Join
Let
LINQ