KO CSharp Operator Cast - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki
ะฃะบัะฐัะฝััะบะฐ ยท ะ ัััะบะธะน ยท English ยท Deutsch ยท Franรงais ยท Italiano ยท Espaรฑol ยท ็น้ซไธญๆ ยท ๆฅๆฌ่ช ยท ํ๊ตญ์ด
๋ช ์์ ๋ณํ
ํธ๋๋ถ C# ยท ์ค์ฉ ๊ฐ์ด๋
๋ช ์์ ๋ณํ, ํนํ ์ซ์, ์ฐธ์กฐ ์บ์คํธ ๋๋ ์ฌ์ฉ์ ์ ์ ๋ช ์์ ์ฐ์ฐ์๋ฅผ ์์ฒญํฉ๋๋ค. ๋ถ๊ฐ๋ฅํ ์ฐธ์กฐ ์บ์คํธ๋ก ์ธํด ์์ธ๊ฐ ๋ฐ์ํฉ๋๋ค.
๊ฐ๋จํ ์์ (Example.cs)
์ด ์์ ๋ฅผ Example.cs๋ก ๋ฐ๋ก ์ ์ฅํ๊ณ ์ด ํ์ด์ง์ ๋ค๋ฅธ ์์ ์ ๋
๋ฆฝ์ ์ผ๋ก ์คํํ์ธ์.
Example.cs:
// PROJECT-EXAMPLE
double value = 3.9;
System.Console.WriteLine((int)value);
๊ฒฐ๊ณผ:
3
ํต์ฌ๋ก
(TargetType)value
์์ 1
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)
{
double value = 12.75;
int whole = (int)value;
Console.WriteLine(whole);
}
}
์์ 2
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)
{
object value = "ore";
string name = (string)value;
Console.WriteLine(name.Length);
}
}
๊ณต์ ์ถ์ฒ: Microsoft ํ์ต.