KO CSharp Operator Lambda - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki
ะฃะบัะฐัะฝััะบะฐ ยท ะ ัััะบะธะน ยท English ยท Deutsch ยท Franรงais ยท Italiano ยท Espaรฑol ยท ็น้ซไธญๆ ยท ๆฅๆฌ่ช ยท ํ๊ตญ์ด
ํธ๋๋ถ C# ยท ์ค์ฉ ๊ฐ์ด๋
์ต๋ช ํจ์ ๋๋ ๊ฐ๊ฒฐํ ํํ์ ๋ณธ๋ฌธ ๋ฉค๋ฒ๋ฅผ ์ ์ธํฉ๋๋ค. ๋งค๊ฐ๋ณ์์ ๊ฒฐ๊ณผ ์ ํ์ ๊ฐ๋ฅํ ๊ฒฝ์ฐ ์ปจํ ์คํธ์์ ์ถ๋ก ๋ฉ๋๋ค.
์ด ์์ ๋ฅผ Example.cs๋ก ๋ฐ๋ก ์ ์ฅํ๊ณ ์ด ํ์ด์ง์ ๋ค๋ฅธ ์์ ์ ๋
๋ฆฝ์ ์ผ๋ก ์คํํ์ธ์.
Example.cs:
// PROJECT-EXAMPLE
System.Func<int, int> twice = value => value * 2;
System.Console.WriteLine(twice(4));๊ฒฐ๊ณผ:
8
value => expression / (left, right) => { ... }using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
public static class Program
{
public static async Task Main(string[] args)
{
Func<int, int> square = value => value * value;
Console.WriteLine(square(4));
}
}using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
public static class Program
{
public static async Task Main(string[] args)
{
int offset = 3;
Func<int, int> adjusted = value => { int result = value + offset; return result; };
Console.WriteLine(adjusted(5));
}
}๊ณต์ ์ถ์ฒ: Microsoft ํ์ต.