KO CSharp Operator Collection Expression - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki
ะฃะบัะฐัะฝััะบะฐ ยท ะ ัััะบะธะน ยท English ยท Deutsch ยท Franรงais ยท Italiano ยท Espaรฑol ยท ็น้ซไธญๆ ยท ๆฅๆฌ่ช ยท ํ๊ตญ์ด
ํธ๋๋ถ C# ยท ์ค์ฉ ๊ฐ์ด๋
์ปฌ๋ ์ ํํ์์๋ ๋์ ์ ํ์ด ํ์ํฉ๋๋ค. ์คํ๋ ๋๋ ๋ค๋ฅธ ์ํ์ค์ ์์๋ฅผ ์ถ๊ฐํฉ๋๋ค. ํ์ฐ๊ณผ ๋ฒ์๋ฅผ ํผ๋ํ์ง ๋ง์ญ์์ค.
์ด ์์ ๋ฅผ Example.cs๋ก ๋ฐ๋ก ์ ์ฅํ๊ณ ์ด ํ์ด์ง์ ๋ค๋ฅธ ์์ ์ ๋
๋ฆฝ์ ์ผ๋ก ์คํํ์ธ์.
Example.cs:
// PROJECT-EXAMPLE
int[] first = [1, 2];
int[] all = [.. first, 3];
System.Console.WriteLine(string.Join(",", all));๊ฒฐ๊ณผ:
1,2,3
int[] values = [1, ..other, 5];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[] middle = [2, 3];
int[] values = [1, ..middle, 4];
Console.WriteLine(string.Join(",", values));
}
}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)
{
List<string> names = ["ore", "wood"];
List<string> all = [..names, "food"];
Console.WriteLine(all.Count);
}
}๊ณต์ ์ถ์ฒ: Microsoft ํ์ต.