The best way to learn C# (pronounced as C sharp) is by practicing and writing a lot of code. This page contains intermediate level code examples of C#. You can test the code and see the results instantly without writing a single word.
Most of the topics contain YouTube videos to show you a step-by-step coding process. Kindly take the references from these code examples and play with them on your own.
Table of Contents | |
C# Single Dimensional
Array
- Read Step-By-Step Article With Images, and Code Examples
- Complete YouTube Video Tutorial
Copy()
MethodSort()
MethodIndexOf()
Method- Example 1
- Example 2
- Single Dimensional Array
IndexOutOfRangeException
- Example 1: Processing Single Dimensional Array With
for Loop
- Example 2: With
for Loop
- Example 3: With
for Loop
- Example 1: Processing Single Dimensional Array With
foreach Loop
- Example 2: With
foreach Loop
C# Rectangular
Array
- Read Step-By-Step Article With Images, and Code Examples
- Create and Assign Values to a Rectangular Array
- Access Individual Rectangular Array Elements
- Example 1: Rectangular 3 by 2 Array
- Example 2: Rectangular 3 by 2 Array of Strings
- Example 3: Rectangular 4 by 2 Array
- Example 4: Rectangular 4 by 1 Array
Getlength
Method of Rectangular Array- Example 1: Processing 3 by 2 Rectangular Array Using Nested
for
Loops - Example 2: Processing 4 by 2 Rectangular Array Using Nested
for
Loops - Example 3: Processing 4 by 1 Rectangular Array Using Nested
for
Loops
C# Jagged
Array
- Read Step-By-Step Article With Images, and Code Examples
- Create and Assign Values to a Jagged Array
- Access Individual Jagged Array Elements
- Example 1: Jagged Array with 3 Rows, Each Contains 1D Array of Integer Values
- Example 2: Jagged Array with 2 Rows, Each Contains 1D Array of Char Values
- Example 3: Jagged Array with 2 Rows, Each Contains 2D Array of Char values
Length
andRank
Properties of a Jagged Array- Example 1: Loop Through Jagged Array Elements Using
for
Loop - Example 2: Loop Through Jagged Array Elements Using
foreach
Loop - Example 3: Loop Through Jagged Array Composed of One-Dimensional Arrays of Char Values
- Example 4: Loop Through Jagged Array Composed of Two-Dimensional Arrays of Char Values
- The
null
Row Problem in a Jagged Array - Jagged Array vs Multidimensional Array