-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
40 lines (34 loc) · 886 Bytes
/
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
// Extension types
// https://github.com/dotnet/csharplang/blob/main/proposals/extensions.md
Console.WriteLine("Test 1");
// C# 3.0 Version
public static class StringExtensionsCsharp3
{
public static bool IsNotNullOrEmpty(this string text)
{
return !string.IsNullOrEmpty(text);
}
}
// C# 13 Version
/*
implicit extension StringExtensionsCsharp13 for string
{
public bool IsNotNullOrEmptyV1()
{
return !string.IsNullOrEmpty(this);
}
public static bool IsNotNullOrEmptyV2(string text)
{
return !IsNullOrEmpty(text);
}
}
public implicit extension Bits for Uint64
{
public bool this[int index]
{
get => (this & Mask(index)) != 0;
set => this = value ? this | Mask(value) : this & !Mash(index);
}
static ulong Mask(int index) => `ul << index;
}
*/