Server Side Programming Articles

Page 778 of 2109

What are the escape sequences supported by C#?

karthikeya Boyini
karthikeya Boyini
Updated on 17-Mar-2026 239 Views

Escape sequences in C# are special character combinations that start with a backslash (\) and represent characters that are difficult or impossible to type directly. These sequences allow you to include special characters like newlines, tabs, quotes, and control characters in your strings. Syntax Following is the syntax for escape sequences in C# − string text = "HelloWorld"; // represents a newline char tab = '\t'; // \t represents a tab character Common Escape Sequences ...

Read More

What are the hidden features of C#?

Chandu yadav
Chandu yadav
Updated on 17-Mar-2026 464 Views

C# contains several powerful but often overlooked features that can significantly improve code readability, safety, and efficiency. These hidden gems can make your C# programming more elegant and productive when used appropriately. Lambda Expressions A lambda expression is a concise way to write anonymous functions using the => operator (called the "goes to" operator). Lambda expressions are commonly used with LINQ operations and delegate assignments. Syntax (parameters) => expression (parameters) => { statements; } Example using System; using System.Linq; class Program { public static void Main() ...

Read More

What are the interfaces implemented by Array class in C#?

Samual Sam
Samual Sam
Updated on 17-Mar-2026 1K+ Views

The System.Array class in C# implements several important interfaces that provide essential functionality for array operations. These interfaces include ICloneable, IList, ICollection, and IEnumerable, each serving specific purposes in array manipulation and iteration. Understanding these interfaces helps you leverage the full capabilities of arrays in C# and work with them more effectively in different scenarios. Interfaces Implemented by Array Class Interface Purpose Key Methods/Properties ICloneable Creates a shallow copy of the array Clone() IList Provides indexed access and modification this[index], Add(), Remove() ICollection Provides count and ...

Read More

What are the prerequisites for learning C#?

Arjun Thakur
Arjun Thakur
Updated on 17-Mar-2026 688 Views

To start learning C#, you should have basic computer knowledge and familiarity with fundamental programming concepts. While prior experience with C or C++ is helpful, it is not mandatory − C# is beginner-friendly and can be your first programming language. Prerequisites Here are the essential prerequisites for learning C# − Basic Computer Skills: Understanding how to navigate files, folders, and install software. Programming Fundamentals: Basic knowledge of variables, loops, and conditional statements (helpful but not required). Mathematical Logic: Understanding of basic mathematical operations and logical thinking. Object-Oriented Concepts: Familiarity ...

Read More

What are tokens in C#?

Samual Sam
Samual Sam
Updated on 17-Mar-2026 3K+ Views

A token is the smallest element of a C# program that the compiler can recognize. Tokens are the building blocks of C# code and include keywords, identifiers, literals, operators, and punctuation marks. Understanding tokens is fundamental to writing valid C# programs. Types of Tokens in C# Keywords int, if, class Reserved words Identifiers myVar, Main Names Literals 42, "hello" Values Operators ...

Read More

What are two-dimensional arrays in C#?

George John
George John
Updated on 17-Mar-2026 465 Views

A two-dimensional array in C# is an array of arrays, where elements are arranged in rows and columns like a table or matrix. It stores data in a grid format with two indices: one for the row and one for the column. Two-dimensional arrays are useful for representing tabular data, matrices, game boards, or any data structure that requires a grid-like organization. Syntax Following is the syntax for declaring a two-dimensional array − datatype[, ] arrayName = new datatype[rows, columns]; Following is the syntax for initializing a two-dimensional array with values − ...

Read More

List down a list of the escape characters in C#

Arjun Thakur
Arjun Thakur
Updated on 17-Mar-2026 1K+ Views

Escape characters in C# are special character sequences that begin with a backslash (\) and represent characters that cannot be directly typed or displayed. They are commonly used in strings, regular expressions, and character literals to represent control characters, special symbols, and Unicode characters. Common Escape Characters The most frequently used escape characters include for new lines, \t for tabs, and " for quotes within strings. Example using System; class Program { static void Main() { Console.WriteLine("Hello\tWorld"); ...

Read More

Log functions in C#

Samual Sam
Samual Sam
Updated on 17-Mar-2026 2K+ Views

With C#, you can easily work with logarithms using the Math class. It provides several methods to calculate logarithms with different bases, including natural logarithms (base e) and common logarithms (base 10). Available Log Methods Method Description Log(Double) Returns the natural (base e) logarithm of a specified number. Log(Double, Double) Returns the logarithm of a specified number in a specified base. Log10(Double) Returns the base 10 logarithm of a specified number. Syntax Following are the syntax forms for logarithm methods − ...

Read More

Logical Operators on String in C#

George John
George John
Updated on 17-Mar-2026 2K+ Views

Logical operators in C# are used to perform logical operations on boolean expressions. When working with strings, these operators are commonly used to evaluate string conditions and create compound boolean expressions for string validation and comparison logic. Logical Operators Operator Description Example && Called Logical AND operator. Returns true if both operands are true. (str != null && str.Length > 0) || Called Logical OR operator. Returns true if at least one operand is true. (str == "" || str == null) ! Called Logical NOT operator. ...

Read More

Mathematical Functions in C#

karthikeya Boyini
karthikeya Boyini
Updated on 17-Mar-2026 2K+ Views

The System.Math class in C# provides methods and properties to perform mathematical operations, trigonometric calculations, logarithmic functions, and other common mathematical computations. All methods in the Math class are static, meaning you can call them directly without creating an instance. Common Mathematical Methods The following table shows some of the most commonly used methods in the Math class − Method Description Abs() Returns the absolute value of a number (works with decimal, double, int, etc.) Ceiling() Returns the smallest integer greater than or equal to the specified number ...

Read More
Showing 7771–7780 of 21,090 articles
« Prev 1 776 777 778 779 780 2109 Next »
Advertisements