سلام بر برنامه نویسان عزیز 😉 در این مطلب آموزش جداکردن و گرفتن فقط اعداد double از یک آرایه با OfType در سی شارپ #C را آماده کردم. انشاالله که این کد سی شارپ براتون مفید باشد.
کد جداکردن و گرفتن فقط اعداد double از یک آرایه با OfType در سی شارپ #C :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class MainClass {
public static void Main() {
object[] numbers = { null, 1.0, "two", 3, 4.0f, 5, "six", 7.0 };
var doubles = numbers.OfType();
Console.WriteLine("Numbers stored as doubles:");
foreach (var d in doubles) {
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class MainClass {
public static void Main() {
object[] numbers = { null, 1.0, "two", 3, 4.0f, 5, "six", 7.0 };
var doubles = numbers.OfType();
Console.WriteLine("Numbers stored as doubles:");
foreach (var d in doubles) {