System.String Class

The string in C# is handled by the System.String class. Before you can create and use strings, you must import the System namespace. There are multiple ways to create a string. String str1; str1…

Random Number Generation

We use the System.Random class to generate random numbers. The Random class provides a method for generating random numbers. Each number has an equal chance of getting picked. We   use the Next method to…

System.Math Class

You can use the System.Math class to perform certain mathematical calculations. You can use its method to round numbers, get the square root of a certain number, or determine the result of…

Date Difference Calculator

This tutorial guides you through the creation of a Time Difference Calculator which determines the difference of two given dates and returns the result in days. The program uses the System.DateTime and System.TimeSpan methods.…

System.DateTime Class

The System.DateTime class of the .NET Framework allows you to use, store, and manipulate data of time and date. It has methods for manipulation of dates such as adding or subtracting…