Contains Method Example in C#

Hi Programmers,welcome to new article of c#.net. This article i’ll write the program for String.Contains method in c# console application. Contains method is used to check substring occurs within string. If substring is found in string, it returns TRUE else FALSE. If value is the empty string empty(“”) then it also return TRUE.Let’s see the […]

Display ASCII Value of String in C#

Hi Programmers , Welcome to new article of c#.net. This article i’ll write the program to display ASCII Value of String in C# console application. To Achieve the exact output we need to use System.Text namespace. Include Encoding classASCII property and GetBytes method, pass string value inside getbytes method and store all into byte array […]

Guid Constructor Examples in C#

Hi Programmers, welcome to new article of c#.net. this article i’ll write the program for Guid Constructor. The GUID stands for Global Unique Identifier. A GUID is a 128-bit integer (16 bytes). It is using whenever we need unique identifier. The Byte array for GUID must be exactly 8 byte long. The string you provide […]

How to Create GUID in C#

Hi Programmers, welcome to new article of c#.net. this article i’ll write the program for GUID. The GUID stands for Global Unique Identifier. A GUID is a 128-bit integer (16 bytes).It is using whenever we need unique identifier. GUID is struct type. we are using NewGuid method to initializes a new instance of the GUID […]

Method Overloading in C#

Hi Programmers,welcome to new article of c#.net. This article i’ll write the program for method overloading in c# console application. Method overloading provide facility of multiple methods in a class with same name but different parameters and types. We can do method method overloading by following ways.1.By altering the number of parameters used.2.By altering the […]

Struct Constructor in C#

Hi Programmers, welcome to new article of c#.net. this article i’ll write the program of struct constructor in c# console application. A struct keyword is used to create a structure. A structure can contains variables,methods,static constructor,parameterized constructor,operators,indexer,events and property.default we cant use with struct constructor. Let’s see the codes. Directly Test below codes in Editor. […]

Structures in C# Explained with Five Examples

Hi Programmers, welcome to new article of c#.net. this article i’ll write the program of structure in c# console application.A struct keyword is used to create a structure. A structure can contains variables,methods,static constructor,parameterized constructor,operators,indexer,events and property.Syntax :struct struct_name {// structure members } 2.structures cannot inherit others structures or classes. see below pic. 3.Structure can […]

Lambda Expressions in C#

Hi Programmers, Welcome to new article of C#.net. This post i’ll write the Program for Lamda Expression in C# Console application. Lamda Expression : It is convenient way of defining an anonymous (unnamed) function.It has two forms 1. Expression lamda : (input-parameter) => expression 2.Statement lamda : (input-parameter) => { }. The Lamda Expression uses […]

Find Largest and Second Largest Number in C#

Hi Programmers, welcome to new article of c#.net. this article i’ll write the program to display Largest and Second Largest Numbers in given array in c# console application. we can achieve the output by using for loop and if else if statement or nested for loop. let’s see codes. Happy Coding…Thanks.

Second Largest & Smallest Elements in an Array in C#

Hi Programmers, welcome to new article of c#.net. this article i’ll write the program to display second largest and smallest elements in c# console application. we can achieve the output by using nested for loop and if statement. let’s see codes. Directly use below codes into Editor.