DEV SCRIPTS

C# Code FAQs

C# Tutorial FAQ
Getting Started

C# (pronounced “C Sharp”) is a simple, modern, general-purpose, object-oriented programming language created by Microsoft alongside the .NET framework. It borrows key concepts from several other languages, most notably Java.

C# could theoretically be compiled to machine code, but in real life it is always used in combination with the .NET framework. Therefore, applications written in C# require the .NET framework to be installed on the computer running them. C# is sometimes referred to as the .NET language because it was designed together with the framework.

C# is a fully object-oriented language — there are no global variables or functions. Everything is wrapped in classes, even simple types like int and string, which inherit from System.Object.

Every C# console application needs a namespace, a class, and a Main method — the entry point of the program. Console.ReadLine() at the end is a common trick to keep the console window open until the user presses Enter.

csharp
using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, world!");
            Console.ReadLine();
        }
    }
}

The using keyword imports a namespace. A namespace is a collection of classes. For example, using System; imports the System namespace, which contains the Console class used for output. Without it you would have to write the full name System.Console.WriteLine() every time.

csharp
using System;              // gives you Console, Math, etc.
using System.Collections.Generic; // gives you List<T>, Dictionary<K,V>, etc.
using System.Linq;         // gives you LINQ extension methods

csharp
// Single-line comment — prefix a line with //

/* Multi-line comment
   Wrap any number of lines between /* and */
*/

/// <summary>
/// XML Documentation comment — used to generate API docs.
/// Appears as IntelliSense tooltips in Visual Studio.
/// </summary>
public string Name { get; set; }

Comments are completely ignored by the compiler and are not included in the final compiled output. Visual Studio’s Task List window tracks special tokens like // TODO: and // HACK:.

Main is the entry point of a C# application — it is the first method executed when the program starts. It is declared as static void Main(string[] args):

  • static — accessible without instantiating the class.
  • void — returns nothing.
  • string[] args — receives any command-line arguments passed to the program.
Variables & Data Types

A variable is declared as <type> <name> = <value>;. C# is strongly typed — you must specify the data type (or use var to let the compiler infer it).

csharp
string firstName = "John";
string lastName  = "Doe";
int    age       = 30;

Console.WriteLine("Name: " + firstName + " " + lastName);

// User input
Console.WriteLine("Enter a new first name:");
firstName = Console.ReadLine();
Console.WriteLine("New name: " + firstName + " " + lastName);

TypeDescriptionExample
boolTrue or falsebool isActive = true;
intWhole numberint count = 42;
doubleDecimal numberdouble pi = 3.14;
floatDecimal (less precision)float temp = 98.6f;
stringText (immutable)string name = "Alice";
charSingle characterchar grade = 'A';

Strings in C# are immutable — methods that appear to change a string actually return a new one.

A local variable is declared inside a method and can only be accessed within that method. A field is declared on the class level and is accessible from all methods of the class.

csharp
class Program
{
    // Class field — accessible from all methods
    private static string helloClass = "Hello, class!";

    static void Main(string[] args)
    {
        string helloLocal = "Hello, local!"; // local variable
        Console.WriteLine(helloLocal);
        Console.WriteLine(Program.helloClass);
        DoStuff();
    }

    static void DoStuff()
    {
        Console.WriteLine("From DoStuff: " + Program.helloClass);
        // helloLocal is NOT accessible here
    }
}

From C# 3.0, the var keyword lets you declare a local variable without explicitly stating the type — the compiler infers it from the right-hand side. The type is resolved at compile time, so there is no runtime overhead.

csharp
// Saves typing with complex types
Dictionary<int, List<string>> dict1 = new Dictionary<int, List<string>>();
var dict2 = new Dictionary<int, List<string>>(); // identical at runtime

// Required for anonymous types
var user = new { Name = "Alice", Age = 30 };
Console.WriteLine(user.Name);

var can only be used inside methods (not at class level) and requires an initializer on the same line.

Value types like int always have a default value (e.g. 0). To allow them to hold null, postfix the type with ?.

csharp
int? nullable = null;

// Two ways to check for null
if (nullable == null) Console.WriteLine("It's null!");
if (!nullable.HasValue) Console.WriteLine("It's null!");

// Safe retrieval — returns 0 if null (int default)
int result = nullable.GetValueOrDefault();

// Assign a value
nullable = 42;
Console.WriteLine(nullable.Value); // 42

A const value must be assigned at declaration and can never change. It must be a compile-time constant (numbers, strings, booleans). A readonly field can be assigned at declaration or in the constructor, and can hold values computed at runtime (e.g. DateTime.Now).

csharp
// const — evaluated at compile time
const int MaxRetries = 3;
const double Pi = 3.14159;

// readonly — evaluated at runtime (constructor ok)
class Config
{
    private readonly DateTime startedAt;

    public Config()
    {
        startedAt = DateTime.Now; // allowed in constructor
    }
}

The dynamic keyword (C# 4.0+) declares a variable whose type is not checked by the compiler — it is resolved at runtime. This is useful for COM interop and working with dynamic data formats like JSON.

csharp
dynamic d = "A string";
Console.WriteLine(d.Length); // 8 — works fine

d = 42; // change type — now it's an int
// Console.WriteLine(d.Length); // RuntimeBinderException!

Warning: Since the compiler skips type-checking on dynamic variables, typos in property names won’t be caught until the code actually runs.

Control Structures

The if statement requires a boolean expression. Unlike some languages, C# does not automatically convert numbers to booleans — you must produce an explicit true/false result.

csharp
int number = 7;

// OR operator: ||   AND operator: &&
if ((number > 10) || (number < 0))
    Console.WriteLine("Out of range!");
else
    Console.WriteLine("Good job!");

// && version (flipped logic)
if ((number <= 10) && (number >= 0))
    Console.WriteLine("In range!");

Use switch when you have many specific values to check against a single variable. Each case ends with break. Multiple cases sharing the same action are simply listed one after another. The default case is optional and handles anything not matched.

csharp
string input = Console.ReadLine();

switch (input.ToLower())
{
    case "yes":
    case "maybe":
        Console.WriteLine("Great!");
        break;
    case "no":
        Console.WriteLine("Too bad!");
        break;
    default:
        Console.WriteLine("I don't understand that!");
        break;
}

csharp
// while — condition checked BEFORE each iteration
int i = 0;
while (i < 5) { Console.WriteLine(i); i++; }

// do/while — condition checked AFTER — runs at least once
do { Console.WriteLine(i); i++; } while (i < 5);

// for — use when you know the number of iterations
for (int j = 0; j < 5; j++)
    Console.WriteLine(j);

// foreach — best for iterating collections
var names = new List<string> { "Alice", "Bob", "Carol" };
foreach (string name in names)
    Console.WriteLine(name);

foreach is the most common loop for collections because it is the most readable and concise.

Classes & OOP

A class is a group of related methods and variables. You create an instance (object) of a class using new, and can create as many instances as needed.

csharp
class Car
{
    private string color;

    public Car(string color)        // constructor
    {
        this.color = color;
    }

    public string Describe()
    {
        return "This car is " + Color;
    }

    public string Color
    {
        get { return color; }
        set { color = value; }
    }
}

// Usage
Car car = new Car("Red");
Console.WriteLine(car.Describe()); // "This car is Red"

Properties give the class control over how a field is read or written — you can add validation, transform values, or restrict access. A public field gives direct, unrestricted access.

csharp
private string _name = "John Doe";

// Full property with validation
public string Name
{
    get { return _name.ToUpper(); }
    set
    {
        if (!value.Contains(" "))
            throw new Exception("Please supply both first and last name!");
        _name = value;
    }
}

// Auto-implemented property — compiler generates the backing field
public string Email { get; set; }

// Auto-implemented with default value (C# 6+)
public string Country { get; set; } = "USA";

// Read-only auto property
public string Id { get; } = Guid.NewGuid().ToString();

By default, parameters are passed by value (a copy). Modifiers change this:

ModifierBehaviour
(none)Copy sent; original unchanged.
refReference to original; can read & write it.
outReference; must be assigned inside the method. Great for returning multiple values.
inRead-only reference; saves copying large structs/strings.
csharp
// ref — modify the caller's variable
void AddFive(ref int n) { n += 5; }
int x = 20;
AddFive(ref x);
Console.WriteLine(x); // 25

// out — return extra values
void DoMath(int a, int b, out int sum, out int diff)
{
    sum  = a + b;
    diff = a - b;
}
DoMath(10, 5, out int s, out int d);
Console.WriteLine(s); // 15
Console.WriteLine(d); // 5

csharp
// Optional parameter — must come last, must have a default value
public int Add(int a, int b, int c = 0)
{
    return a + b + c;
}
Add(3, 4);     // c defaults to 0
Add(3, 4, 2);  // c = 2

// params — accept any number of arguments
public void Greet(params string[] names)
{
    foreach (string name in names)
        Console.WriteLine("Hello " + name);
}
Greet("Alice", "Bob", "Carol"); // any count

Method overloading means defining multiple methods with the same name but different parameter lists. The compiler picks the correct version based on the arguments you supply. This lets you add new functionality without breaking existing callers.

csharp
class SillyMath
{
    public static int Plus(int a, int b)
        => Plus(a, b, 0); // delegate to 3-param version

    public static int Plus(int a, int b, int c)
        => Plus(a, b, c, 0);

    public static int Plus(int a, int b, int c, int d)
        => a + b + c + d;
}

SillyMath.Plus(2, 3);       // 5
SillyMath.Plus(2, 3, 4);    // 9
SillyMath.Plus(1, 2, 3, 4); // 10

A constructor is a special method called when a new instance is created. It has the same name as the class and no return type. You can have multiple constructors (overloaded). One constructor can call another using : this().

A destructor (prefixed with ~) is called by the garbage collector when the object is collected — useful for releasing unmanaged resources.

csharp
class Car
{
    private string color;

    public Car() { }                     // parameterless
    public Car(string color) : this()    // calls parameterless first
    {
        this.color = color;
    }

    ~Car()  // destructor
    {
        Console.WriteLine("Car object destroyed.");
    }
}

ModifierAccessible from
publicAnywhere
protectedSame class and derived classes
internalSame project/assembly only
protected internalSame project + derived classes in other projects
privateSame class only (most restrictive)

Classes and structs default to private. Enums and interfaces default to public.

A static member belongs to the class itself, not to any instance. A static class can’t be instantiated at all — it works as a container for related utility methods.

csharp
// Fully static utility class
public static class Rectangle
{
    public static int CalculateArea(int width, int height)
        => width * height;
}

// Called directly on the class — no new needed
Console.WriteLine(Rectangle.CalculateArea(5, 4)); // 20

A non-static class can still have some static members (e.g. a static helper method) while also being instantiatable.

Use a colon to inherit from a base class. The derived class inherits all non-private members. Use virtual on the base method to allow overriding, and override in the derived class. Use base to call the parent’s version. C# supports single inheritance only (one base class).

csharp
public class Animal
{
    public virtual void Greet()
        => Console.WriteLine("Hello, I'm some sort of animal!");
}

public class Dog : Animal
{
    public override void Greet()
    {
        base.Greet();          // call parent version first
        Console.WriteLine("Yes I am — a dog!");
    }
}

Dog dog = new Dog();
dog.Greet();

An abstract class cannot be instantiated — it exists only as a base. An abstract method has no implementation; every non-abstract subclass must override it. This enforces a contract across all subclasses.

csharp
abstract class FourLeggedAnimal
{
    public abstract string Describe(); // no body — subclasses must implement
}

class Dog : FourLeggedAnimal
{
    public override string Describe() => "I'm a dog!";
}

class Cat : FourLeggedAnimal
{
    public override string Describe() => "I'm a cat!";
}

// Polymorphism — treat all as FourLeggedAnimal
var animals = new List<FourLeggedAnimal> { new Dog(), new Cat() };
foreach (var a in animals)
    Console.WriteLine(a.Describe());

An interface is like a pure contract — no method bodies, no fields. A class that implements an interface must implement all of its members. The key advantage over abstract classes: a class can implement multiple interfaces, while it can only inherit from one base class.

csharp
interface IAnimal
{
    string Describe();
    string Name { get; set; }
}

// Implement multiple interfaces
class Dog : IAnimal, IComparable
{
    public string Name { get; set; }

    public Dog(string name) { Name = name; }

    public string Describe() => "Hello, I'm " + Name;

    public int CompareTo(object obj)
    {
        if (obj is IAnimal other)
            return Name.CompareTo(other.Name);
        return 0;
    }
}

// Because Dog implements IComparable, List.Sort() works
var dogs = new List<Dog> { new Dog("Rex"), new Dog("Ace") };
dogs.Sort();
foreach (var d in dogs) Console.WriteLine(d.Name); // Ace, Rex

A namespace groups related types into a named scope, preventing name conflicts and helping organise large codebases. You import a namespace with using. You can also create an alias for a long namespace name with a Using Alias Directive.

csharp
// Full name (no using needed)
System.IO.File.ReadAllText("test.txt");

// After importing
using System.IO;
File.ReadAllText("test.txt");

// Alias — shortens a long namespace
using MyIO = MyProject.FileSystem.IO;
MyIO.File.HelloWorld();

The partial keyword splits a single class across multiple files. All parts must be in the same namespace and are merged by the compiler. This is commonly used by Visual Studio designers (e.g. WinForms), where auto-generated code lives in one file and your custom code in another.

csharp
// File: PartialClass1.cs
public partial class MyClass
{
    public void HelloWorld() => Console.WriteLine("Hello, world!");
}

// File: PartialClass2.cs
public partial class MyClass
{
    public void HelloUniverse() => Console.WriteLine("Hello, universe!");
}

// Both methods are available on the same class
var obj = new MyClass();
obj.HelloWorld();
obj.HelloUniverse();
Operators

csharp
int a = 42, b = 43;

Console.WriteLine(a == b);  // Equal            → false
Console.WriteLine(a != b);  // Not equal        → true
Console.WriteLine(a >  b);  // Greater than     → false
Console.WriteLine(a <  b);  // Less than        → true
Console.WriteLine(a >= 42); // Greater or equal → true
Console.WriteLine(a <= 42); // Less or equal    → true

Postfix (x++) returns the original value first, then increments. Prefix (++x) increments first, then returns the new value.

csharp
int age = 41;

Console.WriteLine(age++); // prints 41, then age becomes 42
Console.WriteLine(age);   // 42

Console.WriteLine(++age); // age becomes 43, then prints 43
Console.WriteLine(age);   // 43

These are shorthand operators that combine an arithmetic operation with assignment.

csharp
int age = 38;
age += 4;  // age = age + 4  → 42
age -= 4;  // age = age - 4  → 38
age *= 2;  // age = age * 2  → 76
age /= 2;  // age = age / 2  → 38

// Also works for strings
string name = "John";
name += " Doe"; // "John Doe"

The ?? operator returns the left-hand value if it is not null; otherwise it returns the right-hand fallback value. This replaces a verbose null-check in a single expression.

csharp
string suppliedName = null;

// Long form
if (suppliedName == null)
    Console.WriteLine("Hello, Anonymous!");
else
    Console.WriteLine("Hello, " + suppliedName);

// Short form with ??
Console.WriteLine("Hello, " + (suppliedName ?? "Anonymous"));
LINQ

LINQ (Language Integrated Query) lets you query and transform data collections using C# syntax. It works on any IEnumerable<T> — lists, arrays, XML, databases, etc.

csharp
var numbers = new List<int> { 1, 2, 3, 4, 5, 6, 7 };

// Method syntax (lambda) — most commonly used
var evens = numbers.Where(n => n % 2 == 0).ToList();

// Query syntax (SQL-like) — same result
var evensQ = (from n in numbers where n % 2 == 0 select n).ToList();

csharp
var users = new List<User>
{
    new User { Name = "Alice", Age = 30 },
    new User { Name = "Bob",   Age = 17 },
    new User { Name = "Carol", Age = 25 },
};

// Filter adults
var adults = users.Where(u => u.Age >= 18).ToList();

// Chaining — filter AND sort
var sortedAdults = users
    .Where(u => u.Age >= 18)
    .OrderBy(u => u.Name)
    .ToList();

foreach (var u in sortedAdults)
    Console.WriteLine(u.Name + " - " + u.Age);

csharp
var users = new List<User>
{
    new User { Name = "Charlie", Age = 25 },
    new User { Name = "Alice",   Age = 30 },
    new User { Name = "Bob",     Age = 17 },
};

// Sort by name ascending
var byName = users.OrderBy(u => u.Name).ToList();

// Sort by age descending
var byAgeDesc = users.OrderByDescending(u => u.Age).ToList();

// Sort by multiple fields
var multi = users
    .OrderBy(u => u.Age)
    .ThenBy(u => u.Name)
    .ToList();

Take(n) returns the first n items. Skip(n) skips the first n items. Together they are the basis of paging.

csharp
var items = Enumerable.Range(1, 100).ToList(); // 1..100

int pageSize = 10;
int page = 2; // zero-based page index

var pageItems = items
    .Skip(pageSize * page)  // skip first 20
    .Take(pageSize)         // take next 10
    .ToList();

// pageItems = [21, 22, 23, 24, 25, 26, 27, 28, 29, 30]

Select() projects each element into a new form — like a map operation. You can extract a single property, or create entirely new objects.

csharp
var users = new List<User>
{
    new User { Name = "Alice", Age = 30, Mail = "alice@example.com" },
    new User { Name = "Bob",   Age = 17, Mail = "bob@example.com"   },
};

// Extract just names
List<string> names = users.Select(u => u.Name).ToList();

// Create simplified anonymous objects (e.g. for API response)
var simple = users.Select(u => new { u.Name, u.Age }).ToList();

csharp
var users = new List<User>
{
    new User { Name = "Alice", HomeCountry = "USA"     },
    new User { Name = "Bob",   HomeCountry = "USA"     },
    new User { Name = "Klaus", HomeCountry = "Germany" },
};

// Group by country
var byCountry = users.GroupBy(u => u.HomeCountry);

foreach (var group in byCountry)
{
    Console.WriteLine("Users from " + group.Key + ":");
    foreach (var user in group)
        Console.WriteLine("  * " + user.Name);
}

// Composite key — group by country AND age
var composite = users.GroupBy(u => new { u.HomeCountry, u.Age });
Advanced Topics

Anonymous types let you create a simple object on the fly without declaring a class. Properties are readonly and you can’t add new ones after initialization. They are great for temporary results, e.g. simplifying a large object for an API response.

csharp
var user = new { Name = "Alice", Age = 30 };
Console.WriteLine(user.Name + " - " + user.Age);

// Useful for simplifying complex objects
var simplified = new
{
    fileInfo.Name,
    fileInfo.Length
};
Console.WriteLine(simplified.Name + " (" + simplified.Length + " bytes)");

Unlike anonymous types (fixed at creation), an ExpandoObject lets you add properties dynamically at any time. Under the hood it implements IDictionary<string, object>, so you can even iterate over it.

csharp
dynamic user = new System.Dynamic.ExpandoObject();
user.Name     = "Alice";
user.Age      = 30;
user.HomeTown = "Boston"; // added after creation

// Nested
user.Address = new System.Dynamic.ExpandoObject();
user.Address.ZipCode = "02101";

// Iterate all properties
foreach (KeyValuePair<string, object> kvp in user)
    Console.WriteLine(kvp.Key + ": " + kvp.Value);

FeatureArrayList<T>
SizeFixed at creationDynamic — grows/shrinks
Add/RemoveNot supportedAdd(), Remove(), Insert()
LINQ supportYesYes
Type safetyYes (int[])Yes (List<int>)
csharp
// Array — fixed size
string[] arr = { "Alice", "Bob" };

// List — flexible
var list = new List<string> { "Alice", "Bob" };
list.Add("Carol");
list.Remove("Bob");
Console.WriteLine(list.Count); // 2

Generics let you write type-safe, reusable classes and methods that work with any data type without casting. List<T>, Dictionary<K, V>, and many other .NET classes are built on generics.

csharp
// Without generics — needs casting, risks runtime errors
var list1 = new System.Collections.ArrayList();
list1.Add(42);
int val = (int)list1[0]; // must cast

// With generics — type-safe at compile time
var list2 = new List<int>();
list2.Add(42);
int val2 = list2[0]; // no cast needed

Use try/catch/finally to handle runtime errors without crashing the application. The finally block always runs, even if an exception was thrown — ideal for cleanup code.

csharp
try
{
    int result = int.Parse(Console.ReadLine()); // may throw FormatException
    Console.WriteLine(10 / result);             // may throw DivideByZeroException
}
catch (FormatException ex)
{
    Console.WriteLine("Not a valid number: " + ex.Message);
}
catch (DivideByZeroException)
{
    Console.WriteLine("Cannot divide by zero!");
}
catch (Exception ex) // catch-all
{
    Console.WriteLine("Unexpected error: " + ex.Message);
}
finally
{
    Console.WriteLine("Done — this always runs.");
}

A lambda is a short anonymous function written with the => arrow. It is used extensively with LINQ and event handlers.

csharp
// A lambda that takes x and returns x * 2
Func<int, int> doubler = x => x * 2;
Console.WriteLine(doubler(5)); // 10

// Multi-line lambda
Func<int, int, int> add = (a, b) =>
{
    return a + b;
};

// Lambdas in LINQ
var evens = new List<int> { 1, 2, 3, 4, 5 }
    .Where(n => n % 2 == 0)
    .ToList(); // [2, 4]

async/await makes asynchronous code look and behave like synchronous code. Marking a method async allows it to await a long-running operation (network call, file I/O) without blocking the thread.

csharp
using System.Net.Http;

static async Task Main(string[] args)
{
    var client = new HttpClient();

    // await suspends this method, freeing the thread
    string content = await client.GetStringAsync("https://example.com");

    Console.WriteLine("Downloaded: " + content.Length + " chars");
}

// async method must return Task, Task<T>, or void (event handlers only)
async Task<string> FetchData(string url)
{
    var client = new HttpClient();
    return await client.GetStringAsync(url);
}

Different countries format numbers and dates differently. CultureInfo lets you control which format is used when parsing or displaying values. Without it, “1.425” could be parsed as 1.425 in the US but as 1425 in Germany (where . is the thousands separator).

csharp
using System.Globalization;

CultureInfo us = CultureInfo.GetCultureInfo("en-US");
CultureInfo de = CultureInfo.GetCultureInfo("de-DE");

double usNum = double.Parse("1.425", us); // 1.425
double deNum = double.Parse("1.425", de); // 1425 — comma is decimal in Germany!

Console.WriteLine(usNum + " is not the same as " + deNum);

// Format output in a specific culture
float big = 12345.67f;
Console.WriteLine(big.ToString(us)); // 12345.67
Console.WriteLine(big.ToString(de)); // 12345,67

Named parameters let you specify argument names in the method call. This makes calls with many parameters self-documenting, and allows you to supply arguments in any order — useful when skipping to a later optional parameter.

csharp
void PrintUser(int userId, string name, int age = -1, string email = null)
{
    Console.WriteLine(name + " (#" + userId + ")");
}

// Positional — hard to read
PrintUser(1, "Alice", 30, null);

// Named — self-documenting, order doesn't matter
PrintUser(name: "Alice", userId: 1);

// Jump straight to email without supplying age
PrintUser(userId: 2, name: "Bob", email: "bob@example.com");

A Dictionary stores key/value pairs with O(1) average lookup time. Keys must be unique.

csharp
var capitals = new Dictionary<string, string>
{
    { "France", "Paris" },
    { "Germany", "Berlin" }
};

capitals["Japan"] = "Tokyo"; // add or update

// Safe lookup
if (capitals.TryGetValue("France", out string capital))
    Console.WriteLine("Capital of France: " + capital);

// Iterate
foreach (KeyValuePair<string, string> pair in capitals)
    Console.WriteLine(pair.Key + " → " + pair.Value);

String interpolation (C# 6+) embeds expressions directly inside a string literal by prefixing with $. It is more readable than concatenation with +.

csharp
string name = "Alice";
int age = 30;

// Old style — concatenation
Console.WriteLine("Name: " + name + ", Age: " + age);

// String interpolation
Console.WriteLine($"Name: {name}, Age: {age}");

// Expressions inside {}
Console.WriteLine($"In 5 years she will be {age + 5} years old.");

// Format specifiers
double price = 9.99;
Console.WriteLine($"Price: {price:C2}"); // $9.99 (currency format)

ToString() converts any value to a string. Parse() converts a string to a numeric type but throws an exception on invalid input. TryParse() does the same without throwing — it returns false instead, making it the safer choice for user input.

csharp
// ToString — number to string
int num = 42;
string s = num.ToString(); // "42"

// Parse — throws FormatException if input is invalid
int n = int.Parse("123");  // 123
// int bad = int.Parse("abc"); // ⚠ throws!

// TryParse — safe version
string input = Console.ReadLine();
if (int.TryParse(input, out int result))
    Console.WriteLine("You entered: " + result);
else
    Console.WriteLine("That's not a valid number!");

Prev
Next
Drag
Map
HTML Snippets Powered By : XYZScripts.com
Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
Click outside to hide the comparison bar
Compare