-
Notifications
You must be signed in to change notification settings - Fork 56
/
Program.cs
41 lines (37 loc) · 1.12 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Globalization;
namespace CustomLinqExample
{
public static class CustomLinqProvider
{
public static CultureInfo[] Where(this CultureInfo[] cultures,
Predicate<CultureInfo> filter)
{
return Array.FindAll(cultures, filter);
}
public static T[] Select<T>(this CultureInfo[] cultures,
Func<CultureInfo, T> map)
{
var result = new T[cultures.Length];
for (int i = 0; i < cultures.Length; ++i)
{
result[i] = map(cultures[i]);
}
return result;
}
}
class Program
{
static void Main(string[] args)
{
var commaCultures =
from culture in CultureInfo.GetCultures(CultureTypes.AllCultures)
where culture.NumberFormat.NumberDecimalSeparator == ","
select culture.Name;
foreach (string cultureName in commaCultures)
{
Console.WriteLine(cultureName);
}
}
}
}