Creating string array in C#
As array in C# is a reference type, the new keyword is used to create a string array instance. Read more for learning how to create/use string arrays in C#.
As array in C# is a reference type, the new keyword is used to create a string array instance. Read more for learning how to create/use string arrays in C#.
The array is the data structures in C# that can store multiple variables of the same type. For example, you want to store the product_id of the products or roll numbers of the students that are integer types.
A message box or dialog box is used to interact with the users of your application. The purpose of using a message box may include notifying about a particular thing e.g. success message after entering a record.
The Random class of C# can be used for creating the practically usable random numbers like password generator. A few main points about the Random class are:
In this tutorial of C# string comparison, I will show you examples of the following methods/classes: String Compare method, Equals, == operator, CompareTo
The C# for loop is a way to execute a block of code to the specified number of times. The statements inside the for loop keep on executing until the condition is false.
A tuple, introduced in .Net version 4.1, can be defined as a data structure having a specific number and sequence of elements. Learn more by visiting the tutorial.
In this tutorial, I will show you how to sort a list in ascending or descending order by using the C# List Sort method and Linq with orderby keyword.
The Trim() method of strings is used to remove the leading and trailing spaces from the specified string. You may use the trim() method in two ways:
C# ArrayList Class can be defined as an ordered collection of objects. ArrayList is non-generic unlike the List
The C# List is the part of System.Collection.Generic Namespace that represents strongly typed list of objects. The index of list starts at 0.
In C#, a string can be broken by one or more given delimiters by using the Split method. The simple way of using the Split method can be:
Commonly, this is required if you are taking the user input for numbers and this may be taken as “text” or string. So, you have to make sure before performing any actions based on that data to convert that string into int, float ot other numeric data types.
The string replace method is used to return a new string after changing all occurrences of the given substring in the source string.
The switch statement is used as an alternative (and elegantly) to the if..else if a single expression is tested against three or more conditions.