سلام 😉 در این مطلب آموزش نمایش تعداد عناصر غیرتکراری آرایه با متدهای Distinct و Count در c#.net را آماده کردم. انشاالله که این کد براتون مفید باشه.
کد نمایش تعداد عناصر غیرتکراری آرایه با متدهای Distinct و Count در c#.net :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class MainClass {
public static void Main() {
int[] factorsOf300 = { 2, 2, 3, 5, 5 };
int uniqueFactors = factorsOf300.Distinct().Count();
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class MainClass {
public static void Main() {
int[] factorsOf300 = { 2, 2, 3, 5, 5 };
int uniqueFactors = factorsOf300.Distinct().Count();