Category Archives: C#

C# for Loop: Explained with 4 Examples

The for loop is one of the available loops in C sharp programming language. The for loop is used to execute a given block of code repeatedly to the given number of times.

C# while and do while Loops With 3 Examples

The C# while loop is one of the available loops in the C Sharp like in other programming languages. The while loop executes the given statement or block of code repeatedly until the given condition is true.

3 Examples to Learn C# Switch Case in 15 Minutes

The switch statement is a decision-making statement which is used to execute a block of code when you have various blocks in C# program. The C# switch is useful when you have long blocks of if, if..else statement, otherwise.

C if else

C# if .. else and else if Statements: Explained with 3 Demos

The if is a decision-making statement in C# programming which is used to execute a block of code if a given condition evaluates as true.

In other words, if you have more…

C# Tutorial

List of chapters in c# tutorial.

sharp string split

14 Examples to Understand C# String and its Methods – trim, replace, IndexOf and others

A string is a sequence of characters where each character is Unicode character. For example “This is c# programming tutorial” is a simple string.

C-sharp ArrayList

Ways to use C# ArrayList with 4 demos

A C# ArrayList is a class of System.Collection namespace which is just like arrays. However unlike simple arrays the ArrayList in c# is dynamic. That means you can add or remove elements from array list by using index number dynamically. While arrays are fixed in size. The ArrayList dynamically resizes itself as items are added or removed. Also ArrayList can contain mixed items like numbers and strings etc. in a single ArrayList.

C# foreach Statement With 3 Examples

The foreach is used to loop through arrays or collection like lists. The foreach loop is used with c# in statement. This makes process of looping through array or collection elements much simpler. You can use for or while loop as well to iterate through elements however foreach c# is built specifically for arrays or collection to perform desired operation in arrays. You should use c# foreach loop to get information in arrays or collection and not to change the content to avoid unpredictable things.

C sharp array

Easily Learn C# Array with 7 Examples

A C# array is a collection of similar type variables which is fixed in size. To understand array consider this example. If you have to store US state names in variables then you have to create 52 variables like that:

C-sharp List

7 Examples to Learn C# list and its Methods – Sort, Find etc

The list is a collection of elements or variables in specified order. The difference between array and list in C# is that list is dynamic sized whereas arrays are fixed.