Author: Marinko Spasojevic

C# Back to Basics – Work With Strings

The string type represents a character array, and its length is determined by the Length property. All the character positions inside that string are enumerated from 0 to Length-1. C# provides us with many different methods to work with strings and we are going to examine ones that are used most of the time. For the complete navigation of this series check out: C# Back to Basics. If you want to download the source code for our examples, you can do that from here Work With Strings Source Code. So, let’s start. We will learn about the following topics:...

Read More

C# Back to Basics – Input and Output in C#

In this article, we are going to learn how to solve simple problems by using linear structures. We are going to accept inputs, work with them and print the output to the console window. For the complete navigation of this series check out: C# Back to Basics. If you want to download the source code for our examples, you can do that from here Input and Output Source Code. So let’s start. Example 1: Create an application that prints out the sum of two integer values which user inputs in the console window. Let’s create a new console application...

Read More

C# Back to Basics – Type Conversion

In C#, data can be converted from one type to another by using an implicit conversion (automatic) or an explicit conversion (we can choose how it’s done). For the complete navigation of this series check out: C# Back to Basics. So, let’s talk more about that. In this article, we are going to cover: Implicit Conversion Explicit Conversion Using the Convert Class Conclusion Implicit Conversion Many different data could be interpreted by using different types. For example, number 74 can be interpreted as an integer but also as double (74.0). There are two situations in which implicit conversion applies....

Read More

C# Basics – Operators in C#

In this article, we are going to talk about operators in C#, how to use them and what are the differences between each of them. For the complete navigation of this series check out: C# Back to Basics. In this article, we are going to cover: Type of Operators Arithmetic Operators Relational Operators Logical Operators Increment and Decrement Operators Conclusion Type of Operators The most used operators in C# are: Arithmetic Operators Arithmetic operators are defined for all the numeric data types. Operators +, -, *, / represent the basic binary arithmetic operations (addition, subtraction, multiplication and division). Operator...

Read More

C# Back to Basics – C# Data Types, Declarations and Variable Definitions

In C#, different data types are registered differently. Furthermore, different actions are allowed to be executed upon them as well. For different data types, a certain amount of memory space is reserved on our computer. With each data type we define: How to register data in memory The possible values for that data Possible actions on the data So, let’s talk more about data types in C#. For the complete navigation of this series check out: C# Back to Basics. In this article, we are going to cover: Data Type Registration Variables in C# Variable Declarations and Expressions Conclusion...

Read More