Repository navigation
ES CSharp Operator Assignment
Codex edited this page Oct 11, 2026
·
2 revisions
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
Almacena el valor en una variable o miembro grabable. Los formularios compuestos aplican la operación y registran el resultado sin duplicar el cálculo del lado izquierdo.
Guarde este ejemplo por separado como Example.cs. Ejecútelo independientemente de los demás ejemplos de esta página.
Example.cs:
// PROJECT-EXAMPLE
int count = 2;
count += 3;
System.Console.WriteLine(count);Resultado:
5
value = expression / value += amountusing 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 value = 10;
value += 5; value -= 2; value *= 3; value /= 2; value %= 7;
Console.WriteLine(value);
}
}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 mask = 0b0011;
mask |= 0b0100; mask &= 0b0111; mask ^= 0b0001;
mask <<= 2; mask >>= 1; mask >>>= 1;
Console.WriteLine(mask);
}
}Fuente oficial: Microsoft Aprender.
ClassicUO — Bad Newbie & C# Scripts IDE